You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.6, aiohttp 3.5.4, requests 2.21.0 I got a problem
I have a website which should be parsed, if I throw GET request through
requests.Session() I get content and can process it.
If I throw GET through aiohttp.ClientSession(), the system detected me like some bot after moment.
I used different cookies and user agents, nothing changed. The question: how is aiohttp different from another one? How can I solve it?
After debug with mitmproxy i see this:
GET request to /checkcaptcha return 302 to new location (/yaroslavskaya_oblast/cars/all)
GET request to new location return 301 to it self
(aiohttp) second GET request to new location return 302 to /showcaptcha
(requests) GET request to new location return 200 and full html content.
But if i replace session.get(url) to asyncio.get_event_loop().run_in_executor(None, requests.get, url) it work fine!
First part of screen - requests.get, second part aiohttp session.get
After long debuging requests lib and aiohttp lib, i dont find any difference in requests, but it not working correctly.
Steps to reproduce
If you need code to reproduce, i can submit it to gist.
GitMate.io thinks the contributor most likely able to help you is @asvetlov.
Possibly related issues are #3390 (redirects?), #1692 (Can we get the response time?), #499 (Url GET parameters are lost when redirecting), #1876 (Problem with trailer header), and #2566 (how to get post data).
I don't consider it as a bug or problem (at least an aiohttp problem).
The library never has the intention to cheat bot detectors.
The library was never claimed as 100% requests compatible.
I'm closing the issue now. Feel free to open a pull request when you'll find something but I very doubt if any aiohttp committer will spend own spare time working on this.
Long story short
Python 3.6, aiohttp 3.5.4, requests 2.21.0 I got a problem
I have a website which should be parsed, if I throw GET request through
requests.Session() I get content and can process it.
If I throw GET through aiohttp.ClientSession(), the system detected me like some bot after moment.
I used different cookies and user agents, nothing changed. The question: how is aiohttp different from another one? How can I solve it?
After debug with mitmproxy i see this:
But if i replace session.get(url) to asyncio.get_event_loop().run_in_executor(None, requests.get, url) it work fine!
First part of screen - requests.get, second part aiohttp session.get
After long debuging requests lib and aiohttp lib, i dont find any difference in requests, but it not working correctly.
Steps to reproduce
If you need code to reproduce, i can submit it to gist.
Your environment
Python 3.6, aiohttp 3.5.4, requests 2.21.0, Kununtu 18.04
The text was updated successfully, but these errors were encountered: