Open anhtuancta opened 2 years ago
try chrome_options.add_expirimental_option
you can use Selenium_Profiles still in progress//working on btw
Following code works for me
set_device_metrics_override = dict({
"width": 375,
"height": 812,
"deviceScaleFactor": 50,
"mobile": True
})
browser = uc.Chrome(options=options)
browser.execute_cdp_cmd('Emulation.setDeviceMetricsOverride', set_device_metrics_override)
Following code works for me
set_device_metrics_override = dict({ "width": 375, "height": 812, "deviceScaleFactor": 50, "mobile": True }) browser = uc.Chrome(options=options) browser.execute_cdp_cmd('Emulation.setDeviceMetricsOverride', set_device_metrics_override)
Wow it works! amazing legend!
I got this error: File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: cannot parse capability: goog:chromeOptions from invalid argument: unrecognized chrome option: mobileEmulation