As I'm a blogger, I tend to manually research the top 10 results for the keyword I'm willing to rank for. As I got my hands on Keyboard Maestro, I thought of creating a macro, that would display the word count of the top 10 URLs, keyword density, and also all the headings inside those web pages.
For this plugin to work, you need to have SERP.txt under Keyboard Maestro folder in your Applications folder. You also need to add a free Mercury web parser API in the macro. The actions that need your attention are highlighted in red inside the macro.
This macro does four things.
Extract all URLs in Google search results (using @JMichaelTX's [WEB] Get URLs from Google Search Results [Example])
Get word count of the content in the webpages and paste it in the txt file(using Mercury web parser API - https://mercury.postlight.com/web-parser/
Ask for keyword input from you. Displays the number of occurrences of the keyword in the webpages along with the keyword density.
Get all the headings from the output received from the web parser API request (h1 to h6), and paste it in the txt file.
Here is the macro.
This macro will demonstrate you.
- Getting all URLs from Google Search Results
- Getting only the main content/article content out of the webpages
- Getting the word count of the URLs.
- Regex for matching the content inside any header tags.
- Looping through each URL in a list of URLs using Regex matching and performing actions on them.
In case if you want to get the word count and headings of a single copied URL, here it is.
Scrape Single URL.kmmacros (9.7 KB)
In case, if you need only word count of all the Google Search results, How to get the word count of a list of URLs?
Note that, depending upon the Mercury Web Parser and the web page structure, the scraping of headings have a success rate of like 90%. Some URLs may be skipped while scraping search results for headings. But the word count works on all URLs and has 100% success rate