1. 程式人生 > >python爬蟲模塊的安裝

python爬蟲模塊的安裝

all import aid .get bsp 文件 瀏覽器 rip OS

1.Requests模塊的安裝

1 pip3 install requests

技術分享圖片
1 #調用:
2 import requests
3 
4 response = requests.get(https://www.baidu.com)
5 
6 print (response.url)
7 print (response.text)
View Code

2.selenium + webdriver 模塊

安裝selenium

技術分享圖片
1 pip3 install selenium
View Code

安裝webdriver (chromedriver為例)

 1.點擊進行下載相對應的版本 當然本地電腦要安裝谷歌瀏覽器

 2.解壓 然後把.exe 文件copy到python3目錄下的script目錄下

 3.安裝完畢

技術分享圖片
1 #調用
2 from selenium import webdriver
3 browser = webdriver.Chrome()
4 browser.get(https://www.baidu.com)
View Code

python爬蟲模塊的安裝