hi when in a google result page you click on a link you first go in a link in google and then you will redirect to destination page. its because function rwt in onmouse down event. i want to get this link with php but when i send http request to google there isnt any onmousedown in response body how can i send http request just like a browser to get this link?
i tell you with an example when u search "php" in google in result page when u click on a result u first will go to a google url and then u redirect to your url like this: http://www.google.com/url?sa=t&source=web&ct=res&cd=1&ved=0CAgQFjAA&url=http%3A%2F%2Fphp.net%2F&ei=jq6-S_myMaD00gSBwvmlCQ&usg=AFQjCNFREyspp5CvzVpYmRmTltZQc8ldmQ&sig2=4OOdOpzlboTeCKx4i2K_mQ this link count clicks on a page link this link has created with java function rwt. but this function only when u request a google result page with browser will apear but when i request that page with php this function not exist now i want to do like a browser with php to get that link
yes. have your script authenticate (be logged into a google account), accept cookies, send cookies on each pageload, and use a browser's user-agent. it will give you tracking URLs then.
i can send a http request but when i send a http request the body of responsed page is diffrent from a result page that google has responded to a browser. can u give me the full pattern of a http request include user agent cookies and other things that a browser send to google?
set these options: CURLOPT_COOKIEJAR, CURLOPT_USERAGENT alternatively, Google may serve content differently if you don't have javascript (search?q=query vs #q=query loads different pages)
i use this code but it didnt work $ch= curl_init(); // set url //curl_setopt($ch, CURLOPT_URL, "http://pgl.yoyo.org/http/browser-headers.php"); curl_setopt($ch, CURLOPT_URL,"http://www.google.com/search?client=opera&rls=en&q=serial&sourceid=opera&ie=utf-8&oe=utf-8"); //return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Opera/9.80 (Windows NT 6.1; U; en) Presto/2.2.15 Version/10.10"); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookieFileName.txt"); // $output contains the output string $output = curl_exec($ch); // close curl resource to free up system resources curl_close($ch); echo $output; when i turn off cookie enable of my opera browser the response body of google is more like the response body of curl code. how can i tell google with curl that my cookie is enabled?