How to capture google results is the same as that in a browser?

Source: Internet
Author: User
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;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.