私は希望者へのリンクをInterpol websiteから収集しました。約10kのリンクがあります。私はそれを非同期的にgrequests
とする方法を探しているので、1つずつ掻き集めるのに時間がかかります。grequests - 最初の2つの応答200 then 403
これは私のリンクリストのプレビューです:
今のfinal_links[:20]
['https://www.interpol.int/notice/search/wanted/2009-19572',
'https://www.interpol.int/notice/search/wanted/2015-74196',
'https://www.interpol.int/notice/search/wanted/2014-37667',
'https://www.interpol.int/notice/search/wanted/2011-30019',
'https://www.interpol.int/notice/search/wanted/2009-34171',
'https://www.interpol.int/notice/search/wanted/2012-334072',
'https://www.interpol.int/notice/search/wanted/2012-334068',
'https://www.interpol.int/notice/search/wanted/2012-334070',
'https://www.interpol.int/notice/search/wanted/2013-26064',
'https://www.interpol.int/notice/search/wanted/2013-2528',
'https://www.interpol.int/notice/search/wanted/2014-32597',
'https://www.interpol.int/notice/search/wanted/2013-23413',
'https://www.interpol.int/notice/search/wanted/2010-42146',
'https://www.interpol.int/notice/search/wanted/2015-30555',
'https://www.interpol.int/notice/search/wanted/2013-2514',
'https://www.interpol.int/notice/search/wanted/2010-53288',
'https://www.interpol.int/notice/search/wanted/2015-58805',
'https://www.interpol.int/notice/search/wanted/2015-58807',
'https://www.interpol.int/notice/search/wanted/2015-58803',
'https://www.interpol.int/notice/search/wanted/2015-62307']
私はちょうど、各リンクあちこち応答を得るためにしようとしています:
unsent_request = (grequests.get(url) for url in final_links)
results = grequests.map(unsent_request)
結果の最初のカップルは、応答200ですが、そのほとんどは(すべてではないが)403である。それを許さないInterpolサーバーなのか、それとも私が何か間違っている(私はあまりにも欲張りですか?:))? requests
で1つずつ行くとうまくいきます。
これは私が考えたものです。ありがとう。私は「倫理的な」スクレイパーであり続けます:) – pawelty