转载文章:
做selenium自动化项目时需要用的操作方法
selenium中webdriver跳转新页面后定位置新页面的两种方式
window.scrollTo和window.scrollBy
python中selenium操作下拉滚动条方法汇总
options = webdriver.ChromeOptions()无弹窗经典python-selenium小练习
selenium+python设置爬虫代理IP
webdriver中的等待——主要讲解WebDriverWait()
Python Selenium Webdriver常用方法总结
用selenium提取html标签中的@href链接
chrome_options.add_argument('--user-agent=""') # 设置请求头的User-Agent
chrome_options.add_argument('--window-size=1280x1024') # 设置浏览器分辨率(窗口大小)
chrome_options.add_argument('--start-maximized') # 最大化运行(全屏窗口),不设置,取元素会报错
chrome_options.add_argument('--disable-infobars') # 禁用浏览器正在被自动化程序控制的提示
chrome_options.add_argument('--incognito') # 隐身模式(无痕模式)
chrome_options.add_argument('--hide-scrollbars') # 隐藏滚动条, 应对一些特殊页面
chrome_options.add_argument('--disable-javascript') # 禁用javascript
chrome_options.add_argument('--blink-settings=imagesEnabled=false') # 不加载图片, 提升速度
chrome_options.add_argument('--headless') # 浏览器不提供可视化页面
chrome_options.add_argument('--ignore-certificate-errors') # 禁用扩展插件并实现窗口最大化
chrome_options.add_argument('--disable-gpu') # 禁用GPU加速
chrome_options.add_argument('–disable-software-rasterizer')
chrome_options.add_argument('--disable-extensions')
chrome_options.add_argument('--start-maximized')