Python爬虫精进-第9关-selenium-学习记录

本地Chrome浏览器的静默默模式设置:

# 本地Chrome浏览器的静默默模式设置:
from selenium import  webdriver #从selenium库中调用webdriver模块
from selenium.webdriver.chrome.options import Options # 从options模块中调用Options类

chrome_options = Options() # 实例化Option对象
chrome_options.add_argument('--headless') # 把Chrome浏览器设置为静默模式
driver = webdriver.Chrome(options = chrome_options) # 设置引擎为Chrome,在后台默默运行

Python爬虫精进-第9关-selenium-学习记录_第1张图片
selenium的官方文档链
这个链接

Selenium提取数据的方法

Python爬虫精进-第9关-selenium-学习记录_第2张图片

你可能感兴趣的:(Python,#爬虫学习)