Beginner's Guide to Web Automation with Chrome.ahk

Helpful script writing tricks and HowTo's
User avatar
Posts: 122
Joined: 01 Aug 2016, 18:17

Beginner's Guide to Web Automation with Chrome.ahk

24 Jan 2021, 18:43

The Chrome.ahk tools allow you to use a backdoor in the Chrome browser to automate Web pages, but it's not necessarily easy. I watched a couple of the videos for the Chrome.ahk tools and had a little trouble grasping what was going on. (I think the videos assumed a little higher level of knowledge than that of a beginner.) So, I spent some time working on it and produced some "getting started" blogs.

I am by no means an expert, I did get it working on a basic level. I document my experiences in the following blogs:

Automating Web Pages with AutoHotkey October 26, 2020
Although It Comes with a Bit of a Learning Curve, the Chrome.ahk AutoHotkey Library Offers More Precise Source-Level Web Page Automation
Previously, I highlighted the limited techniques available for automating Web pages at the screen-level. The Web browser insulates the user from the underlying HTML and Javascript page code preventing the use of control names for automating Web pages.

In this blog, I introduce source-level Web page automation running a short test script after installing a set of Google Chrome AutoHotkey source-level Web page automation tools—Geekdude’s Chrome.ahk Library. I’ve set up a test page called “Jack’s AutoHotkey Chrome Test Page” for a quick trial of the tools. (When initially viewing the test Web page, you should see a set of three empty input fields: First Name, Last Name, and Street Address.) In this blog, I discuss how to install and set up the Chrome.ahk tools—then access the setup by running a sample AutoHotkey script that automatically fills in the three input fields.

Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 1) November 9, 2020
Analyze Web Page HTML Code to Find Control Names and/or IDs for Writing Javascript Expressions for Automating Web Forms Using the Chrome.ahk Library

Logging into online accounts ranks as one of the most common motivations for AutoHotkey users automating Web pages. Using screen-level AutoHotkey Web page automation can get cumbersome. For more reliable and accurate solutions consider source-level automation using the AutoHotkey Chrome.ahk Library of tools. However, before automating any Web forms with these functions, you need to accomplish two tasks:

Analyze the Web page to identify the target HTML controls’ name or id (e.g. text fields, buttons, etc).
Write Javascript action expressions for use with the Chrome.ahk library.
In this blog, I introduce how to identify the controls required to fill in a Web form. In my next blog, I’ll address the more complex task of writing the Javascript expressions for Web page input.

Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 2) November 16, 2020
How to Write Javascript Code for Web Page Automation Using AutoHotkey Chrome.ahk Tools—Digging into the Quirks of Javascript

In the previous blog (“Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 1)“), I discussed how to reveal Web page control names in the source code. This time, I explain how to use those control names to write Javascript expressions for inserting data into text fields and activating menu items and buttons.

HTML code creates the Web page structure—including editing fields, menus, and buttons. We use Javascript commands to initiate action within the static HTML Web. The functions found in Chrome.ahk AutoHotkey tools use Javascript expressions to send commands to the active Web page by channeling those directives through a Chrome debugger channel. You must use Javascript to communicate with the Web page.

Moving Forward with AutoHotkey Chrome.ahk Tools November 23, 2020
My Last Three Blogs Offer a Basic Introduction to Installing and Running the Chrome.ahk Web Page Automation Tools—Find More Resources for these Useful Functions
In my earlier blogs, I posted a beginner’s introduction to GeekDude’s Chrome.ahk Web page automation tools.

1. Installing Chrome.ahk AutoHotkey Web Page Automation Tools
2. Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 1)
3. Using Chrome.ahk AutoHotkey Tools to Automatically Fill-in Web Forms (Part 2)

I wrote those columns to bridge the gap between the novice-level user and the videos produced by GeekDude and Joe Glines—allowing me to take time for the techniques to ferment in my brainpan. While the videos provide excellent information, they assume a certain level of user experience. Hopefully, my blogs provide enough insight to enable new users to:
  • Develop a basic understanding of how Chrome.ahk functions facilitate the completion of Web forms while highlighting the complications from HTML and Javascript code.
  • Make a decision about whether they will continue to pursue these Web automation techniques.
The Chrome.ahk functions act as important additions to anyone’s AutoHotkey toolbox.

I've been getting quite a bit of interest on the Web so I thought that posting the tutorial links here might help those having trouble getting started.

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 5 guests