- 引言
人生苦短,我用Python。时年六月,岁属夏至......(跑偏了!)这两天在做旅游网站评论爬取,用作***的满意度调查,IPA分析巴拉巴拉的。
-
软件及工具:
Python3.7、Sublime Text 3、Google Chrome(81.0.4044.138)、Chromewebdriver
(为啥提到浏览器版本号,因为要对应的Chromedriver)Chromewebdriver下载地址
下载时选取对应版本,Windows选取chromedriver_win32.zip,win10 64位实测有效。
提醒一下,Chromedriver需要和chrome以及python的执行文件在同一目录下,如果这两步完成后你还是不能使用webdriver,那么你需要将它添加到环境变量中。
-
Python需要引入的模块及方法:
import time
import codecs
from selenium import webdriver #从selenium库中调用webdriver模块
from bs4 import BeautifulSoup #从 bs4模块中 引入BeautifulSoup,在结合的情况下选用
#from selenium.webdriver.chrome.options import Options
# 从options模块中调用O