Mac下載配置Selenium


安裝 selenium

☁  ~  pip3 install selenium
☁  ~  pip3 list selenium
Package    Version
---------- -------
pip        18.0
selenium   3.14.0
setuptools 40.2.0
urllib3    1.23
wheel      0.31.1

安裝 ChromeDriver

Q9I5uV.md.png

  • 查看chrome版本

Q9IG7D.md.png

下載后,將安裝包加入到環境變量。以mac系統為例,將chromedriver移至/usr/bin目錄下即可

☁  ~  sudo mv ~/Downloads/chromedriver /usr/bin

驗證安裝

☁  ~  chromedriver
Starting ChromeDriver 2.41.578706 (5f725d1b4f0a4acbf5259df887244095596231db) on port 9515
Only local connections are allowed.

測試能否調用chrome

☁  ~  ipython
Python 3.7.0 (default, Aug 22 2018, 15:22:33)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from selenium import webdriver

In [2]: browser = webdriver.Chrome()

In [3]:

chrome測試頁

如果能調用chrome瀏覽器,即表示安裝成功

Q9o32n.md.png


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM