Browse Source

add options

master
jyhl 5 years ago
parent
commit
150fb63e02
  1. 10
      demo.py

10
demo.py

@ -65,6 +65,16 @@ chrome.webRequest.onAuthRequired.addListener(
def get_chromedriver(use_proxy=False, user_agent=None): def get_chromedriver(use_proxy=False, user_agent=None):
path = os.path.dirname(os.path.abspath(__file__)) path = os.path.dirname(os.path.abspath(__file__))
chrome_options = webdriver.ChromeOptions() chrome_options = webdriver.ChromeOptions()
# 最大化窗口启动
# chrome_options.add_argument("--start-maximized")
# 如报错 chrome-extensions
# chrome_options.add_argument("--disable-extensions")
# 防止被反爬 关闭webdriver flag
# chrome_options.add_experimental_option('excludeSwitches', ['enable-automation'])
if use_proxy: if use_proxy:
pluginfile = 'proxy_auth_plugin.zip' pluginfile = 'proxy_auth_plugin.zip'

Loading…
Cancel
Save