|
|
|
@ -65,6 +65,16 @@ chrome.webRequest.onAuthRequired.addListener(
|
|
|
|
|
def get_chromedriver(use_proxy=False, user_agent=None): |
|
|
|
|
path = os.path.dirname(os.path.abspath(__file__)) |
|
|
|
|
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: |
|
|
|
|
pluginfile = 'proxy_auth_plugin.zip' |
|
|
|
|
|
|
|
|
|