Making a separate browserforge-injector package
I'm considering separating the the browserforge.injectors submodule into an independently updated browserforge-injector library on pypi in order to:
- Make the injector submodules and dependencies optional to those who do not use BrowserForge for controlled browsing
- Focus on more advanced integration of Playwright/Pyppeteer fingerprinting workarounds that may be out of scope of the base
browserforgepackage - Make the base
browserforgepackage lighter
Does anyone have any thoughts on this? Let me know!
@daijro is it possible to inject generated fingerprint into hrequests or requests
@daijro is it possible to inject generated fingerprint into hrequests or requests
Hi, BrowserForge headers can be easily set to a requests session (see here).
Here are some examples:
Using Requests
import requests
from browserforge.headers import HeaderGenerator
# Create the header generator
headers = HeaderGenerator()
# Build the requests session
session = requests.Session()
session.headers = headers.generate() # Set the session headers
# Send a request
resp = session.get('https://example.com')
print(resp.status_code)
If you're using Requests, you might also want to look into using Hazetunnel to spoof the TLS fingerprint to match the User-Agent browser like hrequests does.
Using Hrequests
import hrequests
from browserforge.headers import HeaderGenerator
# Create a chrome header generator
headers = HeaderGenerator(browser='chrome')
# Build a chrome hrequests session
session = hrequests.Session(browser='chrome')
session.headers = headers.generate() # Set the session headers
# Send a request
resp = session.get('https://example.com')
print(resp.status_code)
Note: Browserforge will be integrated into hrequests in an upcoming update.
Hey @daijro I can try and help with this task if you still interested.
Question: Is there a specific reason for locking Browserforge to version 1.1.2 in hrequests version 0.9.2?