####
Create a new Python virtual environment and install selenium
Create a new Python project,
####
from selenium import webdriver driver = webdriver.Chrome() driver.get("https://www.baidu.com")
###
report errors:
‘chromedriver’ executable needs to be in PAT
###
What should I do?
Download chromedriver
Step 1: check your browser version and enter the URL: chrome://version/
Step 2: download the corresponding version of chromedrive at: http://chromedriver.storage.googleapis.com/index.html
Step 3: put the package under the project directory,
Step 4: modify the code and add the file path of drive,
Here is the code:
###
from selenium import webdriver driver = webdriver.Chrome(executable_path="./chromedriver") driver.get("https://www.baidu.com")
###
Then you can play happily. As long as you master the positioning and various operation APIs, you can basically get started and do your own projects,
###
####
Similar Posts:
- Selenium Error: Message: unknown error: cannot find Chrome binary
- [Solved] Chrome Version Error: Message: session not created: This version of ChromeDriver only supports Chrome version 95
- Chromedriver executable needs to be in path [How to Solve]
- selenium.common.exceptions.WebDriverException: Message: unknown Error: cannot find Chrome binary
- Message: ‘geckodriver’ executable needs to be in PATH. [Solved]
- selenium.common.exceptions.WebDriverException: Message: ‘geckodriver’ executable needs to…
- Error reporting in Firefox using selenium in Python
- How to Solve centos7 selenium–unknown error: DevToolsActivePort file doesn’t exist
- [Solved] Appium Error: selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Can’t stop process; it’s not currently runni…
- Under Ubuntu system, selenium opens the Firefox browser and prompts’ unable to find a matching set of capabilities. And message: connect