diff --git a/DrissionPage/drission.py b/DrissionPage/drission.py index c583e5e..7ff65fe 100644 --- a/DrissionPage/drission.py +++ b/DrissionPage/drission.py @@ -4,16 +4,15 @@ @Contact : g1879@qq.com @File : drission.py """ -from sys import exit -from typing import Union - from requests import Session from requests.cookies import RequestsCookieJar from selenium import webdriver from selenium.common.exceptions import SessionNotCreatedException, WebDriverException from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.webdriver import WebDriver +from sys import exit from tldextract import extract +from typing import Union from .config import (_dict_to_chrome_options, _session_options_to_dict, SessionOptions, DriverOptions, _chrome_options_to_dict, OptionsManager, _cookies_to_tuple) @@ -109,7 +108,7 @@ class Drission(object): # 反反爬设置 try: - self._driver.execute_script('Object.defineProperty(navigator,"webdriver",{get:() => Chrome,});') + self._driver.execute_script('Object.defineProperty(navigator,"webdriver",{get:() => undefined,});') except: pass diff --git a/setup.py b/setup.py index a6e1113..e2ceeb6 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open("README.md", "r", encoding='utf-8') as fh: setup( name="DrissionPage", - version="1.11.3", + version="1.11.4", author="g1879", author_email="g1879@qq.com", description="A module that integrates selenium and requests session, encapsulates common page operations.",