python3 安裝selenium
阿新 • • 發佈:2018-04-02
版本 chrom () get word ref gecko == port
pycharm選擇python3
安裝 pip3
python3 -m pip install -U pip
安裝seleium
pip install selenium
pip install --upgrade seleium (看版本 import seleium 、help(seleium)穩定的版本selenium ==2.48.0 、或pip install selenium==2.48.0)
下載遊覽器驅動
https://github.com/mozilla/geckodriver/releases(firefox)
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ (ie)
http://npm.taobao.org/mirrors/chromedriver (google)
python3 爬蟲
- from selenium import webdriver
- driver = webdriver.Firefox()
- url = ‘http://www.baidu.com/‘
- driver.get(url)
- driver.find_element_by_id(‘kw‘).send_keys()
- driver.find_element_by_id("su").click()
- driver.quit()
python3 安裝selenium