Will php use curl to crawl a page and stop crawling half of the page?

Source: Internet
Author: User
Php uses curl to crawl a page. Will it only crawl half of the page? will php use curl to crawl the page? will it only crawl half of the page? if it stops, is the html code that has been crawled completely returned?


Reply to discussion (solution)

If the other server does not respond to you normally, it will stop. Therefore, you need to check the server status of the other party.
If the rules are correct, you will get the html code that you crawled.

Yes! It can be the reason for the network or the other party
After the interruption, will the data still be completed? It depends on how you write the code.
The conventional writing is naturally absent, because it eventually fails due to timeout.
However, if you specify the saved file CURLOPT_FILE
Or the write callback CURLOPT_WRITEFUNCTION is specified.
Still have the opportunity to get

Yes! It can be the reason for the network or the other party
After the interruption, will the data still be completed? It depends on how you write the code.
The conventional writing is naturally absent, because it eventually fails due to timeout.
However, if you specify the saved file CURLOPT_FILE
Or the write callback CURLOPT_WRITEFUNCTION is specified.
Still have the opportunity to get



Does curl have a function to determine whether the entire page has been loaded?

If the other server does not respond to you normally, it will stop. Therefore, you need to check the server status of the other party.
If the rules are correct, you will get the html code that you crawled.



Does the curl function determine whether the whole page has been loaded? What I need is the loaded page.

Curl_getinfo

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.