selenium高级用法
01 . selenium常见设置
-
创建配置对象
from selenium.webdriver import Chrome, ChromeOptions options = ChromeOptions()
-
添加配置
-
取消测试环境
options.add_experimental_option('excludeSwitches', ['enable-automation'])
-
取消图片加载
options.add_experimental_option("prefs", { "profile.managed_default_content_settings.images": 2})
-
-
创建浏览器对象
b = Chrome(options=options)
-
打开网页
b.get('https://www.jd.com')
02 . selenium页面滚动
from selenium.webdriver import Chrome, ChromeOptions
from selenium