I was wondering if anybody has a decent tutorial for Snoopy PHP class which I don't really understand. It lets a script navigate around a website automatically. I really want to see how to go through successive forms- i.e. a sample code which will search 'test' in google, then search 'test2' on the resulting page, and then be able to scrape some data from the final page. (I know this can be done more easily without Snoopy, but it is just proof-of-concept) If anybody could help me out, I would be VERY grateful. Cheers all
Thanks for looking, but I did have a hunt around and that doesnt have any form input. Anyway, I managed it myself some how But thanks anyway
it would be something like this : include('Snoopy.class.php'); $varkeywords = "le+roi+c'est+moi"; $s = new Snoopy; $googleurl = "http://www.google.com/search?as_q=".urlencode(trim($varkeywords))."&num=50&start=1&hl=en&lr=lang_en"; $s->fetchlinks($googleurl); $myresults = $s->results; echo count($myresults)." results <br />"; for($x=0;$x<count($myresults);$x++) { unset($s); $s = new Snoopy; $s->fetchtext($myresults[$x]); print_r($s->results); flush(); } PHP: a google page has serp-links and cra*-links, and Snoopy don't distinguish so the best solution it to not use Snoopy.