i dont know why this recursive call not works. hmm
Chrome.ahk depends on this specific version https://github.com/G33kDude/AutoHotkey- ... 38238f81e1 of AutoHotkey-JSON that has been forked and modified from Cocobelgica's original to allow for Boolean JSON values and to allow it to exist alongside other versions of AutoHotkey-JSON. You can find that version by clicking through the repository on the GitHub webpage, or by going to the releases tab and downloading the release which includes all of the required dependencies.
GeekDude wrote:Make sure you're downloading the release file "Chrome.ahk_v1.0.zip" from the releases page, not the source code. As you have learned, GitHub does not include submodules (i.e. AutoHotkey-JSON and WebSocket.ahk) in its source downloads. The release has all the #Include's built in (no lib folder needed ).
Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Posted: 08 Mar 2018, 19:41
by Shadowpheonix
In the "pastebin.ahk" example that GeekDude was nice enough to include in the release package, the Tab.Call("DOM.setAttributeValue", {"nodeId": NameNode.NodeId, "name": "value", "value": "ChromeBot"}) line assigns a value to an input field. How would I go about retrieving the value after it was assigned?
Looking over the protocol documentation, there does not appear to be a DOM.getAttributeValue or anything similar. The following snippet is the best I could come up with, but all I get is a single message box with "attributes" = ""...
NameNode := Tab.Call("DOM.querySelector", {"nodeId": RootNode.nodeId, "selector": "input[name=name]"})
Tab.Call("DOM.setAttributeValue", {"nodeId": NameNode.NodeId, "name": "value", "value": "ChromeBot"})
TheNode := Tab.Call("DOM.getAttributes", {"nodeId": NameNode.NodeId})
For k, v in TheNode
MsgBox "%k%" = "%v%"
Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Posted: 08 Mar 2018, 20:16
by Joe Glines
Shadowpheonix wrote:In the "pastebin.ahk" example that GeekDude was nice enough to include in the release package, the Tab.Call("DOM.setAttributeValue", {"nodeId": NameNode.NodeId, "name": "value", "value": "ChromeBot"}) line assigns a value to an input field. How would I go about retrieving the value after it was assigned?
I don't have an example I can post right now but I "solved this" by inserting Java script.
Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Posted: 11 Mar 2018, 13:43
by printer
I want to do Page.printToPDF with a few parameters on a local .html file. Can Chrome.ahk help me do that without rendering the .html in the Chrome window? Any code examples for that would be very appreciated. I want to do the conversion with as little delay as possible.
Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Posted: 13 Mar 2018, 15:12
by kunkel321
Thanks for your work on this, GeekDude! It's a bit above my ability to fully understand, but I wonder: Would it be possible to use this for setting the default printer in Chrome? I have a nice AHK script that (at system startup) reads my IP address, then sets my default Windows printer. Chrome doesn't use the Windows default printer though. It merely reverts to whatever printer was last used.
Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Posted: 14 Mar 2018, 05:51
by printer
Guest wrote:Any particular reason to use Chrome to print pdfs? There are headless solutions which easy scripting options:
No super strong reason really.
But whtmltopdf hasn't been updated since 2016 and the Phantomjs main dev have called it quits and says Headless Chrome is the future.
So I figure I might as well try to learn to work with Headless Chrome. Chrome.ahk looks like a convenient way to start for me, compared to going down the Node and Puppeteer path.
Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Posted: 14 Mar 2018, 09:05
by ramonstart
Hello
Why does the Jxon_Dump method return the "menor preu00E7o do livro" value when the correct text is "menor preço do livro"?
Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Posted: 16 Mar 2018, 18:23
by Shadowpheonix
Joe Glines wrote:
Shadowpheonix wrote:In the "pastebin.ahk" example that GeekDude was nice enough to include in the release package, the Tab.Call("DOM.setAttributeValue", {"nodeId": NameNode.NodeId, "name": "value", "value": "ChromeBot"}) line assigns a value to an input field. How would I go about retrieving the value after it was assigned?
I don't have an example I can post right now but I "solved this" by inserting Java script.
If you happen to come up with an example you can post, it would be most appreciated.
Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Posted: 16 Mar 2018, 18:34
by Joe Glines
Shadowpheonix wrote:If you happen to come up with an example you can post, it would be most appreciated.
I'll try and work on it this weekend. I was in the middle of converting all of my examples to functions (so they'd be easy to adapt) when I got busy...
Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Posted: 17 Mar 2018, 14:21
by Joe Glines
Okay, I created a function which should help some people (noobs). It leverages GeekDude's Chrome class.
And this is a video walking through how to use it. It isn't great, but will help some people get their feet wet.
Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Posted: 18 Mar 2018, 22:07
by fenchai
Is there any reason everytime chrome opens, it shows something about windows defender wanting to reset my chrome preferences and adobe and google drive keep wanting to install? this is weird.
Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Posted: 19 Mar 2018, 12:37
by Shadowpheonix
Joe Glines wrote:Okay, I created a function which should help some people (noobs). It leverages GeekDude's Chrome class.
And this is a video walking through how to use it. It isn't great, but will help some people get their feet wet.
This function definitely has a lower learning curve to it than Tab.Call() and Tab.Evaluate() for writing values. Thank you for posting it.
However, this still leaves me clueless as to how to read an existing value from a web page in Chrome without having to install Selenium.
Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!
Posted: 19 Mar 2018, 12:42
by Shadowpheonix
fenchai wrote:Is there any reason everytime chrome opens, it shows something about windows defender wanting to reset my chrome preferences and adobe and google drive keep wanting to install? this is weird.
This sounds like a problem with either your Chrome profile or with an extension/plugin you have installed in Chrome.
If you haven't already done so, try running with a brand new profile in Chrome and see if the issue still occurs. I am not sure what else to suggest if that fails.