From f6c0b72f390379098af339a48fc2ac85377c26b3 Mon Sep 17 00:00:00 2001 From: g1879 Date: Tue, 26 Oct 2021 15:09:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=96=84=E5=8F=8D=E5=8F=8D=E7=88=AC?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/drission.py | 7 +++---- setup.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) 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.",