First let me say, I have seen this question posted many times before and I have read the majority of the solutions but I am still having issues.
I am using a MacBook (10.15.6) and Safari (13.1.2). I am using PyCharm 2020.1.4 and have a program written for python 3.8 using selenium 3.14.1, which connects to Youtube (any website really- I have tried Google as well) and sends a search term. The issue that I keep having is that Selenium cannot connect to the web driver.
I have followed the steps from previous posts to allow Remote Automation from the developer tab, as well as manually executing safari driver (safaridriver --enable) from the terminal screen.
I have tried similar sample connection code for Chrome as well, and get similar errors.
Here is the code that I am running:
from selenium import webdriver
driver = webdriver.Safari()
driver.get('https://youtube.com')
searchbox = driver.find_element_by_xpath('//*[@id="search"]')
searchbox.send_keys('Paint Drying')
Here is the Tracebacklog::
/Users/Fudgey/PycharmProjects/Web_Scrape/venv/bin/python /Users/Fudgey/PycharmProjects/Web_Scrape/web_auto_seln_v0.py
Traceback (most recent call last):
File "/Users/Fudgey/PycharmProjects/Web_Scrape/web_auto_seln_v0.py", line 3, in <module>
driver = webdriver.Safari()
File "/Users/Fudgey/PycharmProjects/Web_Scrape/venv/lib/python3.8/site-packages/selenium/webdriver/safari/webdriver.py", line 56, in __init__
self.service.start()
File "/Users/Fudgey/PycharmProjects/Web_Scrape/venv/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 104, in start
raise WebDriverException("Can not connect to the Service %s" % self.path)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service /usr/bin/safaridriver