简体   繁体   中英

How to set grequests timeout

How would I accomplish the following:

rs = (self.exporter.grequester(url) for url in url_chunk)
res_items = grequests.map(rs, timeout=10s) # this is the item that times out

Try this:

reqs = grequests.map(grequests.get(link, headers=header,  timeout=1) for link in links)

source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM