In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "classic examples commonly used in php curl". In daily operation, I believe many people have doubts about the classic examples commonly used in php curl. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "classic examples commonly used in php curl"! Next, please follow the editor to study!
I use php, curl is mainly to grab data, of course, we can use other methods to grab, such as fsockopen,file_get_contents and so on. But can only grasp those pages that can be accessed directly, if you want to grab the page with page access control, or log in to the page after it is more difficult.
1. Crawl files without access control
2. Use the agent to crawl
Why use proxies for crawling? Take google as an example, if you grab google data frequently in a short period of time, you will not be able to grab it. Google imposes restrictions on your ip address. At this time, you can change agents to re-arrest.
3After recording post data, grab the data
Separately talk about data submission data, because when using curl, there will be data interaction, so it is more important.
In the upload.php file, print_r ($_ POST); using curl, you can grab the content Array of upload.php output ([name] = > test [sex] = > 1 [birth] = > 20101010)
4. Grab some pages with page access control
I have written an article before, and you can take a look at the three methods of page access control if you are interested.
If you use the method mentioned above, the following error will be reported
You are not authorized to view this page
You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending a WWW-Authenticate header field that the Web server is not configured to accept.
At this point, we are going to use CURLOPT_USERPWD for verification.
At this point, the study of "classic examples commonly used in php curl" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.