I used requests to write a multi-thread, but it feels a bit slow. Are there any other methods?
PHPz2017-05-18 10:58:14
Use Tornado’s curl client support to close the connection after reading the request header. (I haven’t tried it yet. If the HTTP client it provides does not support closing the connection midway, you can use TCP and then use http-parser to parse it like I did.)
Okay, actually you can just add an extension to fetchtitle to get the status code... (remember to install pycurl)
巴扎黑2017-05-18 10:58:14
Python is inherently slow. If you want to be fast, just write the tcp request directly and then read the reply. After reading the status, close the socket.
ringa_lee2017-05-18 10:58:14
Using grequests, requests are encapsulated concurrently
https://github.com/kennethrei...
迷茫2017-05-18 10:58:14
In this case, you can consider using gevent, tornado, scrapy-redis, asyncio!