hrequests
hrequests copied to clipboard
Browser version selection not showing in request Header
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
Also tried it and can confirm it doesn't respect the version setting.
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