For Linux system, running Selnium script will report the following error
Traceback (most recent call last):
File "./obp_pb_get_csv.py", line 73, in <module>
browser = webdriver.Chrome('/usr/bin/chromium') # Get local session of chrome
File "/usr/lib64/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 46, in __init__
self.service.start()
File "/usr/lib64/python2.7/site-packages/selenium/webdriver/chrome/service.py", line 64, in start
raise WebDriverException("Can not connect to the ChromeDriver")
selenium.common.exceptions.WebDriverException: Message: 'Can not connect to the ChromeDriver'
Solution:
1. Confirm whether Chrome browser is installed, command: Chrome browser - version code> 0
2. If not, use the following command to install: code> sudo apt get install chromium browser
3. Get chromedriver and visit the following link http://chromedriver.storage.googleapis.com/index.html
4. Decompress Chromdriver.zip
5. Move the file to the path/usr/bin, command: sudo MV chromedriver/usr/bin
6. Switch to/usr/bin directory, command: CD/usr/bin
7. Make it executable, command: sudo Chmod a + X chromedriver
8. Perform the following code tests:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("http://www.google.com")
print driver.page_source.encode('utf-8')
driver.quit()
display.stop()
Read More:
- Solve selenium error — unknown error: devtoolsactivport file doesn’t exist
- Selenium driver chrome failed to start and reported an error
- [Solved] selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn
- Using selenium server- standalone.jar Console error: unknown error: cannot get automation extension solution
- how to install chrome in kali linux
- How To Install Google Chrome on Linux Mint 19
- Solve cannot execute binary file: exec format error under Linux
- ubuntu-how to solve the error-Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release
- [solution] Google Chrome browser hijacked by hao123 chrome://version Command line tampered
- launch failed.Binary Not found in Linux / Ubuntu solution
- Get picture captcha with Python + Chrome
- Solution of selenium driven edge error reporting
- PySpark ERROR Shell: Failed to locate the winutils binary in the hadoop binary path
- Open the top left corner of the chrome page to display the volume and playback chrome.exe Problem solving
- Linux find file text command (find | grep)
- To solve the running error of eclipse for C / C + +: launch failed binary not found
- How to solve the problem of Cannot find module’npmlog’ when installing nodejs under Linux
- Error reporting using selenium in pycharm
- Common linux commands — find command’s Exec
- Linux c running error killed