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

Browser version selection not showing in request Header #26

Open
VCoves opened this issue Nov 13, 2023 · 2 comments
Open

Browser version selection not showing in request Header #26

VCoves opened this issue Nov 13, 2023 · 2 comments
Labels
question Further information is requested

Comments

@VCoves
Copy link

VCoves commented Nov 13, 2023

How to reproduce issue:
session = hrequests.Session(browser='chrome', version=112)
resp = session.get("https://httpbin.org/headers")
print(resp.json())
It will show a different version in Chrome/114.0.5731.1, Instead of expected Chrome/112.X.X.X

@rhoekman
Copy link

Also tried it and can confirm it doesn't respect the version setting.

@daijro
Copy link
Owner

daijro commented Feb 4, 2024

Hello, this was a decision I chose to make a while back. I explained it a little here.

At the moment, the version parameter only sets the TLS fingerprint version, not the header.
Due to there being much more User-Agents than TLS finerprints avaliable, I needed to cut down a lot of potential unique headers to make the user agents match their TLS finerprint version. Websites rarely compare the User-Agent to the browser's TLS fingerprint, so I didn't think the sacrifice of potential User-Agents was worth it, especially for larger scale scraping where requests need to look as unique as possible.

However, I could definitely make Chrome's User-Agent adhere to its TLS profile since there are so many different versions for each major release. But I can't for Firefox since it does not have many potential User-Agents per release. I'm not sure though, I'll need some more thoughts on this

@daijro daijro added the question Further information is requested label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants