Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET redirect problem #3608

Closed
ZeroTworu opened this issue Feb 14, 2019 · 2 comments
Closed

GET redirect problem #3608

ZeroTworu opened this issue Feb 14, 2019 · 2 comments
Labels

Comments

@ZeroTworu
Copy link

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:

  1. GET request to /checkcaptcha return 302 to new location (/yaroslavskaya_oblast/cars/all)
  2. GET request to new location return 301 to it self
  3. (aiohttp) second GET request to new location return 302 to /showcaptcha
  4. (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
    default

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

@aio-libs-bot
Copy link

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).

@asvetlov asvetlov removed the bug label Feb 14, 2019
@asvetlov
Copy link
Member

I don't consider it as a bug or problem (at least an aiohttp problem).

  1. The library never has the intention to cheat bot detectors.
  2. 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.

@lock lock bot added the outdated label Feb 14, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants