aminblm / linkedin-application-bot

A python bot to apply all Linkedin Easy Apply jobs based on your preferences.
https://www.linkedin.com/pulse/open-source-project-1-linkedin-application-bot-your-amin-sa8af/
Other
139 stars 58 forks source link

selenium.common.exceptions.NoSuchDriverException #11

Closed alpersarac closed 1 year ago

alpersarac commented 1 year ago

I am getting this exception below I don't why

Traceback (most recent call last): File "C:\Users\90507\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\common\driver_finder.py", line 42, in get_path path = SeleniumManager().driver_location(options) if path is None else path ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\90507\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 74, in driver_location browser = options.capabilities["browserName"] ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'capabilities'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\90507\linkedin-application-bot\linkedin.py", line 247, in Linkedin().driver.quit() ^^^^^^^^^^ File "C:\Users\90507\linkedin-application-bot\linkedin.py", line 38, in init self.driver = webdriver.Chrome(ChromeDriverManager().install()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\90507\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 47, in init self.service.path = DriverFinder.get_path(self.service, self.options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\90507\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\common\driver_finder.py", line 44, in get_path raise NoSuchDriverException(f"Unable to obtain {service.path} using Selenium Manager; {err}") selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain chromedriver using Selenium Manager; 'str' object has no attribute 'capabilities'; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

alpersarac commented 1 year ago

I solved the problem by replacing self.driver = webdriver.Firefox(executable_path=GeckoDriverManager().install()) this line in LinkedIn.py with: self.driver = webdriver.Firefox(service=Service(executable_path=GeckoDriverManager().install()))

cohenaj194 commented 1 year ago

Yep that fixed mine too

alpersarac commented 1 year ago

I am glad you fixed the issue

aminblm commented 1 year ago

Thank you for fixing it @alpersarac

alpersarac commented 1 year ago

Thank you for fixing it @alpersarac

My pleasure