Can specify a user agent for browser control?
Thanks.
Code: Select all
Gui Add, ActiveX, w980 h640 vWB, Shell.Explorer
WB.Navigate("https://autohotkey.com/boards/")
Gui Show
Code: Select all
Gui Add, ActiveX, w980 h640 vWB, Shell.Explorer
WB.Navigate("https://autohotkey.com/boards/")
Gui Show
Code: Select all
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET", "https://www.google.com/search?btnI&q=apples+oranges", true)
whr.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36")
whr.Send()
whr.WaitForResponse()
html := whr.ResponseText
;// write the Google Source to an HTMLfile
document := ComObjCreate("HTMLfile")
document.write(html)
;// loop through all the links
links := document.links
while (A_Index<=links.length, i:=A_Index-1)
If !InStr(links[i].href, "about:")
list .= i ") " links[i].innerText "`nURL: " links[i].href "`n`n"
MsgBox, %list%
Users browsing this forum: Bing [Bot], Google [Bot], peter_ahk and 353 guests