ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
10.04k stars 1.16k forks source link

Simulate an android chrome user #661

Open PePinodemrs opened 2 years ago

PePinodemrs commented 2 years ago

Hello, how can i simulate an android chrome user plz ?

PePinodemrs commented 2 years ago

When i use mobileEmulation it say me that it not recognise this whereas in sleenium it's worked

sebdelsol commented 2 years ago

mobileEmulation experimental option is not supported on undetected-chromedriver. It seems there's a workaround by setting the chromedriver capabilities:

PePinodemrs commented 2 years ago

I think it's only for java and not python

sebdelsol commented 2 years ago

Then you have to translate in Python, Selenium methods are named quite the same.

PePinodemrs commented 2 years ago

Then you have to translate in Python, Selenium methods are named quite the same.

I really don't understand how it's work, i've tried that : cap = DesiredCapabilities.CHROME.copy() cap['platform'] = "mac" cap['version'] = "10" cap['deviceName'] = "Apple iPhone 6" print(cap) but it do nothing

kaliiiiiiiiii commented 2 years ago

you can use Selenium_Profiles Repo still in progress//working on btw

desis123 commented 1 year ago

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)