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

Access to MobileEmulation features of Chrome Webdrivers #196

Open
jkersch opened this issue Oct 13, 2024 · 0 comments
Open

Access to MobileEmulation features of Chrome Webdrivers #196

jkersch opened this issue Oct 13, 2024 · 0 comments

Comments

@jkersch
Copy link

jkersch commented Oct 13, 2024

Hi,

is there a way to modify the MobileEmulation features of chrome? (at least i have not find a simple way to access the underlying chromedriver from the source code) or at least expose access to an underlying chromium/chrome instance?

with selenium you could set something like

mobile_emulation = { "deviceMetrics": { "width": 360, "height": 640, "pixelRatio": 3.0 }, "userAgent": "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19", "clientHints": {"platform": "Android", "mobile": True} } chrome_options = Options() chrome_options.add_experimental_option("mobileEmulation", mobile_emulation) driver = webdriver.Chrome(chrome_options = chrome_options)

to set mobile device specifics like DeviceMetrics or Client Hints. That way also DPI specifics (not just resolution) could be set to emulate mobile clients, which would be relevant in my use case.
I would like to use botasaurus but see no way to set these specifics to the actual browser engines.

thanks
j.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant