Web Scraping Example with AutoHotkey-Scraping website to determine status

Web Scraping Example with AutoHotkey

The term Web Scraping is well known but I’ve yet to hear much talk about “Web Pasting”.   In this Web Scraping Example with AutoHotkey video I demonstrate how I helped my Real Estate agent automate checking the status of a house on a website.

Web Scraping example with AutoHotkey

Here is a second version where, depending on the status of the home, I write a follow-up email either with an email from Outlook or within the website via COM.

 

Transposing clipboard content in any program- No need to run to Excel!

Transposing clipboard content

While it is easy to use Excel to transpose rows into columns, I’ve created an AutoHotkey script which negates the need to.  Basically it examines what is on the clipboard and replaces tabs with line breaks, then it sends paste to the program thus it is transposing clipboard content.  I have it triggered of hitting a hotkey and comes in pretty handy and can save some time if it is something you do frequently.

Below is a video which demonstrates it usage.

 
^+t:: ;Control, Shift and T trigger script
    StringReplace, clipboard, clipboard,%A_Tab%, `r , All ;replace all tabs with line return
  SendPlay,^v   ;send "paste"
  Return

Transposing clipboard content

Automating StumbleUpon submissions with AutoHotKey

automating StumbleUpon submissions

Automating StumbleUpon submissions

I had over 100 URLs I wanted to submit to StumbleUpon.com and wanted to tag them with around 12 interests. This would have taken me quite some to do manually so I wrote an AutoHotKey script to web scrape and cranked it out in no time!
Below is the video demonstrating the Automating StumbleUpon submissions.

And here is the first draft of my script  (I only included 3 urls in this example)

Interests:="Self Improvement|Gadgets|Technology|Internet|Computers|Internet Tools|Hacking|Software|Computer Science|Programming|Open Source|Computer Security|Web Development|IT|Windows"
urls=
(
Using 6 built-in SciTE Find and Replace features- Great time savers!
https://the-automator.com/gui-menu-for-api-web-service
Excellent SciTE editor video documenting powerful features
) ;***********Loop over StumbleUpon Submissions******************* Loop, parse, URLs, `n, `r ;loop over Var line by line { IfEqual, A_LoopField,,continue ;Skip loop if blank ;automating StumbleUpon submissions pwb := WBGet() pwb.Navigate("http://www.stumbleupon.com/submit") ;Navigate to URL while pwb.busy or pwb.ReadyState != 4 ;Wait for page to load Sleep, 100 ;~ pwb.document.all.url.Value :=A_LoopField ;Unique ID -no dashes Sleep, 400 Clipboard:=A_LoopField pwb.document.all.url.focus() pwb.document.ExecCommand("paste") ; paste pwb.document.all.nsfw[0].focus() ;~ pwb.document.all.nsfw[0].checked :=1 ;Set Tagname and Array value pwb.document.all.nsfw[0].Click() pwb.document.all.nsfw[0].fireEvent("onchange") Loop, parse, Interests, | ;loop over interests { DDL:=pwb.document.getElementByID("submit-search-interests-dropview").getElementsByClassName("droplist dropdown-menu")[0].getElementsByClassName("animated-item-view rendered animated-item-view-end") IfEqual, A_LoopField,,continue ;Skip loop if blank pwb.document.getElementByid("submit-search-interests").focus() ;~ pwb.document.getElementByid("submit-search-interests").value:=A_LoopField Clipboard:=A_Loopfield pwb.document.getElementByid("submit-search-interests").focus() pwb.document.ExecCommand("paste") ; paste - triggers DOM/javascript events WinActivate, StumbleUpon loop, % (ddl.length) { if (trim(DDL[A_index-1].innerTEXT) =A_LoopField){ ;~ MsgBox % trim(DDL[A_index-1].innerTEXT) Sleep, 500 pwb.document.getElementByid("submit-search-interests").focus() Sleep, 500 SendPlay, {Down} Sleep, 500 SendPlay, {Enter} } } } ;***********submit StumbleUpon submissions******************* sleep, 1000 pwb.document.getElementByID("submit-view-save").click() ;***********Cancel navigate away from page and just submit******************* WinWaitActive,Windows Internet Explorer WinActivate, Windows Internet Explorer ;~ https://autohotkey.com/board/topic/38243-fill-form-in-the-background-logging-into-account/ ControlClick,Button2,ahk_class #32770,The webpage you are viewing is trying to close the tab. Sleep, 1000 } ;End loop over pages MsgBox complete automating StumbleUpon submissions