[Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!

Post your working scripts, libraries and tools
LeonR22
Posts: 1
Joined: 06 Jun 2019, 05:36

Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!

06 Jun 2019, 05:39

@GeekDude
Thanks a lot for posting this! It has been very useful!
I do have a problem.. Whenever i open more than 6 chrome instances, i can not control the 7th instance of chrome. I am using different ports for all of the instances. Any idea what could be causing this?

Thnx!
gregster
Posts: 2660
Joined: 30 Sep 2013, 06:48

Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!

06 Jun 2019, 09:39

I seem to remember something about the maximum number of WebSocket connections being 6 by default - but I don't know enough about websockets to know if this applies here, but I would guess that this is related: https://www.autohotkey.com/boards/viewtopic.php?f=6&t=35117&p=279726#p279726

But do you really need so many chrome instances? You know that you can open additional tabs in already existing instances, if needed?

I think you can also have different so-called browser contexts (Google debug protocol docs:"Similar to an incognito profile but you can have more than one.") in one browser instance but I am not sure if this is possible with the current implementation of Chrome.ahk... I tried it some time ago, iirc, but couldn't get it to work (doesn't mean anything - I might try it again). Edit: I think I figured it out now.
bmilcs
Posts: 8
Joined: 27 Feb 2017, 13:54

Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!

06 Jun 2019, 10:26

Leon, I got around the issue by adding connects & disconnects to every function. Unless you need to have 6 scripts in action at once, you should just disconnect & reconnect as needed; it's been working like a charm for me for some time now. I can't thank GeekDude enough!

Question
https://www.amazon.com

Using manual timers and hotkeys, I was able to change the zip code & apply it. However, they must've changed the code and I'm hoping I can get a better solution for the following:

1. Click Deliver to... (Easy enough)
https://i.imgur.com/HT78GoE.png

2. Wait for pop-up, then click "Change" URL (How would I achieve this without the use of sleep?)
https://i.imgur.com/3XrXrZ3.png

3. Wait for Input Box to appear, change .value() (How do I wait for the input box to appear?)
https://i.imgur.com/AnXoHM4.png

PS: I'm a novice coder at best and don't practice it by trade. What exactly allows for web site's to do this kind of animation in the first place, without going to a fresh url? Is it javascript? css? html5? I'm at a loss.

EDIT: Why is this breaking my links? :(

[Mod edit: Links repaired.]
RinkaDink
Posts: 21
Joined: 03 Sep 2018, 14:52
Facebook: 1982
Google: 1982

Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!

29 Jun 2019, 18:40

Dear Geekdude,

I want to thank you and all for sharing your codes and helping all with it.

As a newbie to AHK, DOM usage and JS it would be great if anyone could give me some examples of probably basic stuff.
I tend to not asking to provide a ready script as I really want to learn to do it myself but it helps a lot to get a direction.

What would help me or maybe other more unexperienced users would be an example with very basic expressions.

May I ask if anyone could provide based on the AHK board starting page: https://www.autohotkey.com/boards/

1) Codeline just to Focus the Searchbox in the upper right . (DOM indicated the ID as = "keywords"
2) Codeline to insert text to the Searchbox in the upper right
3) Codeline to click the search button (class = "button button-search")

thanks!

Best regards
RinkaDink
Tre4shunter
Posts: 37
Joined: 26 Jan 2016, 16:05

Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!

02 Jul 2019, 13:50

Hey Rinkadink - have you looked at the examples included with the Chrome.ahk class? They should tell you what you need to know - but if you are still confused, let me know and i can work up a quick example for you if you think you still need it.

And thanks to Geekdude of course! Amazing work as always.
rommmcek
Posts: 623
Joined: 15 Aug 2014, 15:18

Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!

05 Jul 2019, 11:58

@RinkaDink: I posted here an example few weeks ago.
JaxD
Posts: 9
Joined: 28 Jul 2019, 01:21

Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!

03 Aug 2019, 06:20

hi,

is there a documetation/help file for this?
madsounds
Posts: 5
Joined: 31 May 2019, 08:14

Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!

06 Aug 2019, 13:48

Hi, I'm using some site that periodically opens new tab. But when new tab is opening, Chrome is stealing the focus. And even if Chrome is minimized, it restores the window.

So is it possible to prevent Chrome from stealing focus? Or maybe there's way to launch Chrome hidden? I know there's AHK command WinHide - and it works until, again, new tab is opened.
bmilcs
Posts: 8
Joined: 27 Feb 2017, 13:54

Re: [Library] Chrome.ahk - Automate Google Chrome using native AutoHotkey. No Selenium!

19 Aug 2019, 14:10

I'm having trouble scraping a .aspx based site. It requires a log-in so URLDownloadToFile isn't an option. However, I am able to manually save the content of the page to a .html file.

How would I go about automating this via this wonderful resource?

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Gio and 50 guests