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
9.17k stars 1.1k forks source link

AttributeError: 'str' object has no attribute '_session' #733

Open Bits4Bux opened 2 years ago

Bits4Bux commented 2 years ago

Hello, I got this error:

Traceback (most recent call last): File "C:\Users\JustAnotherUser\Downloads\Bot\main\SoundCloud.py", line 16, in driver = webdriver.Chrome("C:\Users\JustAnotherUser\Downloads\Bot\main\chromedriver.exe") File "C:\Users\JustAnotherUser\Downloads\Bot\main\undetected_chromedriver__init.py", line 248, in init__ options._session = self AttributeError: 'str' object has no attribute '_session'

Process finished with exit code 1

Can anyone help?

byteDrifter commented 1 year ago

have you tried if __name__ == __main__:

jamesr657 commented 1 year ago

Having issues with this as well, "have you tried if name == main:" Did not work for me. Please let me know if you figure out a fix :)

Monir-Nassan commented 1 year ago

I had the same error and i fixed it with by initializing the options options = webdriver.ChromeOptions() driver = webdriver.Chrome(options=options)