标签:imp sel rom head python set 火狐 ESS https
上示例:
谷歌浏览器
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.headless = True
driver = webdriver.Chrome(options=options)
# 调试时无法用driver.maximize_window()这个函数将窗口最大化,导致截图有问题
# 但下面这个函数可以设置窗口大小
driver.set_window_size(1500,800)
driver.get(‘https://www.baidu.com‘)
火狐浏览器
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.headless = True
driver = webdriver.Firefox(options=options)
driver.set_window_size(1500,800)
driver.get(‘https://www.baidu.com‘)
IE和Edge浏览器貌似用上面方法不行,将继续研究
标签:imp sel rom head python set 火狐 ESS https
原文地址:https://www.cnblogs.com/sue2015/p/14933169.html