[Python]如何使用selenium

python网路爬虫教学-Selenium基本操作
download chrome drive
https://www.whatismybrowser.com/detect/what-version-of-chrome-do-i-have
https://chromedriver.chromium.org/downloads
建议chromedrive和测试用程序放同一个资料夹
https://ithelp.ithome.com.tw/upload/images/20201012/20119608qvIp6eQ4yM.jpg

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()

https://ithelp.ithome.com.tw/upload/images/20201012/20119608n8wUoeuZeF.jpg


<<:  【Day.30】React进阶 - Styled-Components: React的CSS解决方案 | 系列总结

>>:  Day30 结语

【不是铁人赛】Day 01|虚拟货币价格预测(一)资料处理

友:你要不要一起参加铁人赛? 我:好啊! (几天後) 我:乾我不小心忘了报名...... ----...

Day07. 想练成 Blue Prism太极拳吗? 忘记所有的招式吧!-从Excel Worksheet读取表格资料

想练成 Blue Prism太极拳吗? 忘记所有的招式吧! (以上画面撷取自网路) 或许有点年纪的人...

一条龙,你会了吗 - 用Django建立整合AD登入

说明 本篇将继续介绍使用django-social-auth设定整合Activate Directo...

[Day07] Service 与 Dependency Injection (依赖注入)

什麽是依赖注入 在说明什麽是 Dependency Injection(DI, 依赖注入)前,要先来...

Day8 - 读 Concurrency is not Parallelism - Rob Pike (三)

续上篇,Day7 - 读 Concurrency is not Parallelism - Rob ...