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
- Solving windows error: [error 87] classification: problem summary
- Get picture captcha with Python + Chrome
- WindowsError: [Error 2] The system cannot find the file specified
- Using selenium server- standalone.jar Console error: unknown error: cannot get automation extension solution
- How to install IDM Extension in Chromium-based Microsoft Edge (Canary/Dev)
- Chrome Failed to load resource: net::ERR_CACHE_MISS
- Solution to x service error when installing NVIDIA graphics driver under Ubuntu
- how to install chrome in kali linux
- Mac upgrade pip
- Error encountered while executing PIP install: error: complete output from command Python setup.py egg_ info:
- Points for attention in setting up robot framework + Python 3.7.0 environment
- Python selenium — webriver cheat sheet
- Chrome setting — Disable web security to solve cross domain problems
- django.core.exceptions . improveconfigured: error loading MySQL DB module. Django configuring MySQL database
- Building wheel for wrapt (setup.py) … error
- ubuntu-how to solve the error-Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release
- Windows git review reported an error. UnicodeDecodeError
- cannot import name ‘_validate_lengths’ from ‘numpy.lib.arraypad’
- The problem of “value error: zero length field name in format” in Python 2.6.6 of CentOS 6.9