> >

Re: PHP cURL to achieve simulation login and collection method of use

time:17-06-29 forum:PHP tools and code
  Eight, multithread acquisition of

for large collection work, in order to improve the efficiency of collection, multi-threaded acquisition provided by PHP cURL is essential. The multi thread collection example provided in the manual seems not to be very good, and I've just started testing several examples from it, but I found that all the execution cards were dead, it was impossible to perform it, and a few days before, I suddenly tested it again, and then found that the Example #1 under the curl_multi_info_read function is execable, its content. On $res, but not printed, and YAHOO's request is relatively slow, will be stuck, the front two links can return normally.
but, fortunately, the example is not good, then I through the search to find a good project, CurlMulti
https://github.com/ares333/php-curlmulti
I don't introduce much about the use of CurlMulti. It provides demo on the official website. The use process has a technical problem that can be directly added to the Q group (cURL advanced technology 215348766), and the author @Ares and other collection cows will provide technical solutions.
below is a simple example of PHP cURL Multi:

[code] $urls = array (
array)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

prev:PHP curl function simulated crawler (ope... next:Advantages and disadvantages of cURL, fi...
post comments
Notice



Approved   The inheritance of the old Ji'nan ha...   Do not belittle those street cars, t...   South Korea's chief mother is popula...   The 3 year old was elected the young...   The Qilu Public Welfare Alliance has...
rand   PHP gets Cookie analog login   PHP curl function to simulate crawle...   PHP curl function simulation browser...   PHP uses curl to simulate user landi...   MYSQL query optimization
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com