Challenge, get html source code for Google search results

Get help with using AutoHotkey and its commands and hotkeys
pubuntu
Posts: 9
Joined: 22 May 2014, 00:05

Challenge, get html source code for Google search results

26 Jul 2014, 04:19

my method can't work..

Code: Select all

SetWorkingDir, %A_ScriptDir%
#Include %A_ScriptDir%\httprequest.ahk

	weburl=http://64.233.167.44/#newwindow=1&q=autohotkey
;;;Method 1
	URLDownloadToFile, %weburl%,%A_Desktop%\Google1.html
;;;Method 2
	HTTPRequest(weburl, InOutData := "")
	FileAppend, %InOutData%, %A_Desktop%\Google2.html
Both method 1 and method 2 can get correct inclusion search results page source code.
How to get? Can you help me?
User avatar
Blackholyman
Posts: 1291
Joined: 29 Sep 2013, 22:57
Facebook: socialjsz
Google: +Jszapp
Location: Denmark
Contact:

Re: Challenge, get html source code for Google search result

26 Jul 2014, 06:31

Code: Select all

wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := true
wb.Navigate("http://google.com/#newwindow=1&q=autohotkey")

while WB.readyState!=4 || WB.document.readyState != "complete" || WB.busy
	continue
sleep 500
msgbox % wb.document.getElementById("ires").innertext
pubuntu
Posts: 9
Joined: 22 May 2014, 00:05

Re: Challenge, get html source code for Google search result

26 Jul 2014, 19:21

Blackholyman wrote:

Code: Select all

wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := true
wb.Navigate("http://google.com/#newwindow=1&q=autohotkey")
while WB.readyState!=4 || WB.document.readyState != "complete" || WB.busy
	continue
sleep 500
msgbox % wb.document.getElementById("ires").innertext
First of all thank you . But I want is the HTML code, not for Webpage content.
ahcahc
Posts: 110
Joined: 25 Jul 2014, 23:55

Re: Challenge, get html source code for Google search result

26 Jul 2014, 22:08

Code: Select all

html := wb.document.documentElement.innerHTML
msgbox % html
pubuntu
Posts: 9
Joined: 22 May 2014, 00:05

Re: Challenge, get html source code for Google search result

26 Jul 2014, 23:18

ahcahc wrote:

Code: Select all

html := wb.document.documentElement.innerHTML
msgbox % html
Google's pages are reassembled by js. The browser can properly resolve, but not downloaded. Unresolved access to the code. So, I just said it was a challenge.
Attachments
GoogleError.png

Return to “Ask For Help”

Who is online

Users browsing this forum: afe, AHK_user, AHKStudent and 152 guests