Scene
When using selenium, an error is reported one day, as shown in the title, and the code is as follows:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
option = Options()
option.add_argument('--headless')
option.add_argument('--no-sandbox')
option.add_argument('--disable-dev-shm-usage')
browser = webdriver.Chrome('./chromedriver',chrome_options=option)
browser.get('http://www.baidu.com/')
print(browser.title)
browser.quit()
Solution:
First, ensure that the versions of Google Chrome and chrome River are consistent. If you are sure to be consistent, skip the following three steps.
-
- View Google Chrome version command:
google-chrome --version
I’m not sure about the command to view the chrome River version, but if you find the Google Chrome version, you can go to the following website to download the corresponding chrome river. If the versions are inconsistent, you need to download the consistent version from the download location
-
- google-chrome: http://dist.control.lth.se/public/CentOS-7/x86_64/google.x86_64/chromedriver: https://sites.google.com/a/chromium.org/chromedriver/downloads
Then the solution is to add an option
option.add_argument("--remote-debugging-port=9222") # this
Read More:
- [Solved] harbor Error: because it doesn‘t contain any IP SANs
- How to Solve TypeError: type numpy.ndarray doesn‘t define __round__ method
- [Solved] Synergy Error: ERROR: ssl certificate doesn‘t exist
- error: unknown type name ‘uint8_t‘ [Howt to Solve]
- [Solved] MySQL workbench Error: SSL connection error: SSL is required but the server doesn‘t support it.
- Grpc Error: failed to unmarshal the received message proto: can‘t skip unknown wire type 7
- [Solved] Adb Shell Monkey Warning: can‘t create log.txt, Read-only file system
- [Solved] UE4 Error: Couldn‘t find file for package *** requested by async loading code. NameToLoad: ***
- [Solved] MYSQLD: Can‘t create directory ‘/usr/local/mysql/data/’(Errcode:2 -No such file or directory)
- [Solved] selenium.common.exceptions.WebDriverException: Message: An unknown server-side error
- How to Solve Angular Error: error NG8002: Can‘t bind to ‘ngModel‘ since it isn‘t a known property of ‘input‘.
- PHP Parse error: syntax error, unexpected ‘class‘ (T_CLASS), expecting identifier (T_STRING)
- jupyter notebook Sets Default Browser Error: SyntaxError: (unicode error) ‘utf-8‘ codec can‘t decode byte 0xd4
- Solve chrome running error unknown error: cannot get automation extension
- How to Solve TypeError: type numpy.ndarray doesn’t define __round__ method
- ApplicationContext.xml file header error Referenced file contains errors
- [Solved] ERROR: You don‘t have the SNMP perl module installed.
- Unknown SSL protocol error in connection to xxx:443 [How to Solve]
- [Solved] Ubuntu uses gym to save the video error: “unknown encoder ‘libx264′”
- [How to Solve Vue warn]: Unknown custom element: did you register the component correctly?