good evening dear php-experts,
I'm pretty new to php programming especially.
I would like to scrape the web finding a certain string using curl. I've been trying setting different user agents, and setting other options but I just can't seem to get the urls of that pages, I believe it has something to do with the fact that the query string gets encoded somewhere but I'm really not sure how to get around that.
Nonetheless, I'm trying to get done a very simple script for retriving data web and parsing.i think that this is a a great strarting point to for beginners on weekend codes. but at the moment i got troubles.
i need to fetch all the urls that contain this term;
this term: /participants-database/
//$url is the same as the link above
$ch = curl_init();
$user_agent='Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0'
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch,CURLOPT_CONNECTTIMEOUT,120);
curl_setopt ($ch,CURLOPT_TIMEOUT,120);
curl_setopt ($ch,CURLOPT_MAXREDIRS,10);
curl_setopt ($ch,CURLOPT_COOKIEFILE,"cookie.txt");
curl_setopt ($ch,CURLOPT_COOKIEJAR,"cookie.txt");
echo curl_exec ($ch);
i need to fetch all the urls that contain this term;
/participants-database/
Well - Probably this kind of stuff is trivial in PHP. Here PHP is a great language - a good language.
love to hear from you
dil-bert