from selenium import webdriver
from selenium.webdriver.chrome.service import Service
try:
# browser = webdriver.Chrome('Here is the path to chrome')
s = Service(r"/opt/apps/cn.google.chrome/files/chrome")
driver = webdriver.Chrome(service=s)
driver.get('https://www.baidu.com')
except Exception as e:
print(e)
When running this code, an error is reported. You need to put the chrome file and chromedriver in the same directory
Just add the path
Read More:
- [Solved] selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn
- [Solved] unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.36.540471
- [Solved] Python Selenium Error: AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_xpath‘
- [Solved] Unable to find “…\setuptools-40.8.0-py3.7.egg\EGG-INFO“ when adding binary and data files
- [Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘
- [Solved] Selenium.common.exceptions.WebDriverException: Message: newSession
- [Solved] Python Image Library fails with message “decoder JPEG not available” – PIL
- npm install Error: stack Error: Can’t find Python executable “python”
- Importerror: DLL load failed: unable to find the specified module in Python
- Python recursively traverses all files in the directory to find the specified file
- Using Python error urlopen error unknown URL type: the solution of HTTPS
- [Solved] Selenium python send_key error: list object has no attribute
- How to Solve Python Importerror: DLL load failed: unable to find the specified program using tensorflow
- [Solved] torchvision Error: UserWarning: Failed to load image Python extension: Could not find module
- Python: Django exception when executing migrate operation: django.db.utils.OperationalError: (1051, “Unknown table’xxx’”)
- [Solved] Windows Python Upzip rar File Error: Cannot find working tool
- [leetcode] 295. Find Median from Data Stream Python
- CMake Error at Could NOT find Python3 [Solved]
- [Solved] AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_id‘
- Python RarFile unpack RAR package Error Rarfile.RarCannotExec: Cannot find Working Tool