Jump to content

_ScreenScrape UDF


Alterego
 Share

Recommended Posts

  • 3 weeks later...

This example code will return the the number of pages Google has indexed on every single datacenter. This is very useful for webmasters observing the "google dance", which is pretty much a constant anymore.

#Include <Array.au3>
#include <Misc.au3>
Global $results
;the website to check
Global $website = 'autoitscript.com'
;all of Google's datacenters
$DCs = StringSplit('64.233.161.99,64.233.161.104,64.233.161.105,64.233.161.147,64.233.167.99,64.233.167.104,64.233.1


67.147,64.233.171.99,64.233.171.104,64.233.171.105,64.233.171.147,64.233.179.99,64.233.179.99,64.233


.183.99,64.233.183.104,64.233.185.99,64.233.185.104,64.233.187.99,64.233.187.104,64.233.189.104,66.1


02.7.104,66.102.7.105,66.102.7.147,66.102.9.104,66.102.11.104,216.239.37.104,216.239.37.105,216.239.


37.147,216.239.39.104,216.239.53.104,216.239.57.98,216.239.57.104,216.239.57.105,216.239.57.147,216.


239.59.104,216.239.59.105,216.239.63.104', ',')
For $loop = 1 To $DCs[0]
;the scraping code. i found very small unique before and after strings which are optimal.
    Global $pagesingoogle = _ScreenScrape ('http://' & $DCs[$loop] & '/search?hl=en&q=site%3A' & $website & '&btnG=Google+Search', 't <b>', '</b> f')
;update $results to equal the datacenter, a colon, the number of pages, and a line break for every iteration
    $results = $results & @CRLF & $DCs[$loop] & ' : ' & $pagesingoogle
Next
ClipPut($results)

code is also attached.

scrapegoogledatacenters.au3

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...