How to crawl the pages of other sites to complement
Source: Internet
Author: User
In the actual application, often encounter some special circumstances, such as the need for news, weather, and so on, but as a personal site or the strength of small sites we can not have so much human and financial resources to do these things, how to do?
Fortunately, the Internet is a resource-sharing, we can use the program automatically to the other site crawl back after processing by our use.
With what, the comrade to give is not, in fact, PHP has this function, that is, with Curl Library. Please look at the code below!
<?php
But sometimes there are some errors, but in fact have been downloaded! I asked the foreigner, they did not give me an answer, I think it is not, just add a function in front; so we can secretly crawl Sina's news as long as we have a proper analysis of $txt. However, it is still not necessary for the good! To avoid legal disputes, here just want to tell you PHP's function is very powerful! You can do a lot of things!
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.