How to capture the google results is the same as that in the browser. I use the phpcurl extension function to capture the page data with google keywords. However, the results returned by crawling with headers are inconsistent with those returned by the browser. So I beg someone who can tell me how to make the page results captured by my program consistent with the page results displayed by the browser. How to capture google results is the same as that in browsers
I am using the php curl extension function to capture page data with google keywords, but the results returned by crawling with headers are still inconsistent with those returned by the browser.
So I beg someone who can tell me how to make the page results captured by my program consistent with the page results displayed by the browser.
Thank you.
Only 20 points. I hope the experts will forgive me.
------ Solution --------------------
In this way, you can change the url address.
PHP code
Header ("Content-type: text/html; charset = utf-8"); $ ch = curl_init (); $ url = 'http: // www.google.com/search? Hl = zh-CN & biw = 1366 & bih = 649 & q = ajax & oq = ajax + comment & aq = f & aqi = g9g-m1 & aql = & gs_sm = e & gs_upl = 5916l9958l0l10319l16l14l1l0l0l0l267l1925l0. 6.4l10l0 '; curl_setopt ($ ch, CURLOPT_URL, $ url); curl_setopt ($ ch, hour, 1); curl_setopt ($ ch, CURLOPT_USERAGENT, 'mozilla/5.0 (Windows; U; windows NT 6.1; en-US; rv: 1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5 '); $ htmls = curl_exec ($ ch); curl_close ($ ch ); echo $ htmls;