Jump to content
UBot Underground

Google scrape Title + URL in table, what's wrong with my script?


Recommended Posts

Try it yourself ... it leaves out Titles, so the final table is false.

 

### script:

 

ui stat monitor("Results", $list total(%results))

ui stat monitor("ResultsURL", $list total(%resultsurl))

clear list(%results)

clear list(%resultsurl)

clear table(&final)

navigate("http://www.google.de/#hl=de&cp=3&gs_id=b&xhr=t&q=ayurveda&pf=p&sclient=psy-ab&site=&source=hp&pbx=1&oq=ayu&aq=0&aqi=g4&aql=&gs_sm=&gs_upl=&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=368126ad50e1de32&biw=830&bih=489", "Wait")

loop(10) {

add list to list(%results, $scrape attribute(<outerhtml=w"<h3 class=\"r\">*</h3>">, "innertext"), "Delete", "Global")

add list to list(%resultsurl, $scrape attribute(<class="l">, "href"), "Delete", "Global")

click(<outerhtml=w"<a id=\"*\" class=\"*\" style=\"*\" href=\"*\"><span class=\"*\" style=\"*\"></span><span style=\"*\"><b>Weiter</b></span></a>">, "Left Click", "No")

wait for browser event("Everything Loaded", "")

wait($rand(3, 6))

}

add list to table as column(&final, 0, 1, %results)

add list to table as column(&final, 0, 2, %resultsurl)

save to file("{$special folder("Desktop")}/ergebnis.txt", &final)

Link to post
Share on other sites

Try this:

ui stat monitor("Results", $list total(%results))
ui stat monitor("ResultsURL", $list total(%resultsurl))
clear list(%results)
clear list(%resultsurl)
clear table(&final)
navigate("http://www.google.de/#hl=de&cp=3&gs_id=b&xhr=t&q=ayurveda&pf=p&sclient=psy-ab&site=&source=hp&pbx=1&oq=ayu&aq=0&aqi=g4&aql=&gs_sm=&gs_upl=&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=368126ad50e1de32&biw=830&bih=489", "Wait")
loop(10) {
   add list to list(%results, $scrape attribute(<outerhtml=w"<h3 class=\"r\">*</h3>">, "innertext"), "Don\'t Delete", "Global")
   add list to list(%resultsurl, $scrape attribute(<class="l">, "href"), "Don\'t Delete", "Global")
   click(<outerhtml=w"<a id=\"*\" class=\"*\" style=\"*\" href=\"*\"><span class=\"*\" style=\"*\"></span><span style=\"*\"><b>Weiter</b></span></a>">, "Left Click", "No")
   wait for browser event("Everything Loaded", "")
   wait($rand(3, 6))
}
add list to table as column(&final, 0, 1, %results)
add list to table as column(&final, 0, 2, %resultsurl)
save to file("{$special folder("Desktop")}/ergebnis.csv", &final)

 

I just changed your add to list to not delete the duplicates. Im sure there's a duplicate title in the result thats why it doesn't match with the urls. Check it.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...