Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Created June 1, 2021 16:06
Show Gist options
  • Save JoeGlines/b16f40dc147d6861d94b20f627b6cc73 to your computer and use it in GitHub Desktop.
Save JoeGlines/b16f40dc147d6861d94b20f627b6cc73 to your computer and use it in GitHub Desktop.
#SingleInstance,Force
;**************************************
Area_Code:="267"
Prefix:="777"
pwb := WBGet()
pwb.Navigate("http://www.fonefinder.net/findome.php?npa=" Area_Code "&nxx=" Prefix) ;Navigate to URL
while pwb.busy or pwb.ReadyState != 4 ;Wait for page to load
Sleep, 100
Row:=pwb.document.GetElementsByTagName("table")[1].GetElementsByTagName("TR")[1]
Loop, % Row.GetElementsByTagName("TD").length {
If (A_Index=3)
City:=Row.GetElementsByTagName("TD")[A_Index-1].InnerText
If (A_Index=4)
State:=Row.GetElementsByTagName("TD")[A_Index-1].InnerText
If (A_Index=5)
Tel_Comp:=Row.GetElementsByTagName("TD")[A_Index-1].InnerText
If (A_Index=6)
Carrier_Type:=Row.GetElementsByTagName("TD")[A_Index-1].InnerText
}
MsgBox % City a_tab State a_tab Tel_comp a_tab Carrier_Type
;*******************************************************
;~ Alternatively you could skip the above loop and just do...
City:=Row.GetElementsByTagName("TD")[2].InnerText
State:=Row.GetElementsByTagName("TD")[3].InnerText
Tel_Comp:=Row.GetElementsByTagName("TD")[4].InnerText
Carrier_Type:=Row.GetElementsByTagName("TD")[5].InnerText
MsgBox % City a_tab State a_tab Tel_comp a_tab Carrier_Type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment