kaliiiiiiiiii / Selenium-Profiles

undetected Selenium using chromedriver and emulation / device profiles
Other
272 stars 29 forks source link

Support selenium>=-4.11.1 #86

Closed igu closed 1 year ago

igu commented 1 year ago

Describe the bug I am unable to execute the example from the readme of this repository.

To Reproduce

from selenium_profiles.webdriver import Chrome
from selenium_profiles.profiles import profiles
from selenium.webdriver.common.by import By  # locate elements
from seleniumwire import webdriver

profile = profiles.Windows() # or .Android
options = webdriver.ChromeOptions()
options.add_argument("--headless=new")
driver = Chrome(profile, options=options,
                uc_driver=False
                )

# get url
driver.get('https://abrahamjuliot.github.io/creepjs/')  # test fingerprint

input("Press ENTER to exit: ")
driver.quit()  # Execute on the End!

Expected behavior or error-message Open example Start Driver from README but catch on Error.

Traceback (most recent call last):
  File "main.py", line 10, in <module>
    driver = Chrome(profile, options=options,
  File "/home/guus/.local/lib/python3.8/site-packages/selenium_profiles/webdriver.py", line 112, in __init__
    options_manager.Options.binary_location = chrome_binary
  File "/home/guus/.local/lib/python3.8/site-packages/selenium/webdriver/chromium/options.py", line 55, in binary_location
    raise TypeError(self.BINARY_LOCATION_ERROR)
TypeError: Binary Location Must be a String

Environment

Additional context Python 3.8.12 version

kaliiiiiiiiii commented 1 year ago

try following:

from selenium_profiles.webdriver import Chrome
from selenium_profiles.profiles import profiles
from selenium.webdriver.common.by import By  # locate elements
from seleniumwire import webdriver

profile = profiles.Windows() # or .Android
options = webdriver.ChromeOptions()
options.add_argument("--headless=new")
driver = Chrome(profile, options=options,
                uc_driver=False, chrome_binary="/usr/bin/google-chrome"
                )

# get url
driver.get('https://abrahamjuliot.github.io/creepjs/')  # test fingerprint

input("Press ENTER to exit: ")
driver.quit()  # Execute on the End!
kaliiiiiiiiii commented 1 year ago

Support selenium>=-4.11.1 https://github.com/SeleniumHQ/selenium/commit/7c7790d70840e1f9c9bf4a74e3d4ac4a957befcf#diff-fcc9ec4d166a8e1bb6636d0a871b3298a5633ff8bf938cde23d222fbd909117eR55