python網路爬蟲教學-Selenium基本操作
download chrome drive
https://www.whatismybrowser.com/detect/what-version-of-chrome-do-i-have
https://chromedriver.chromium.org/downloads
建議chromedrive和測試用程式放同一個資料夾
Starting ChromeDriver 86.0.4240.22 (398b0743353ff36fb1b82468f63a3a93b4e2e89e-refs/branch-heads/4240@{#378}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
pip3 install selenium
Collecting selenium
Downloading https://files.pythonhosted.org/packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl (904kB)
|████████████████████████████████| 911kB 285kB/s
Requirement already satisfied: urllib3 in c:\python37\lib\site-packages (from selenium) (1.25.7)
Installing collected packages: selenium
Successfully installed selenium-3.141.0
test4.py
from selenium import webdriver
driver = webdriver.Chrome('./chromedriver')
driver.get("https://freelancerlife.info/") #前往這個網址
driver.close()