From 233c50f118310b15927c5129d9052ce187e7d0c7 Mon Sep 17 00:00:00 2001 From: g1879 Date: Fri, 29 Oct 2021 18:16:01 +0800 Subject: [PATCH] =?UTF-8?q?1.11.5=20=E4=BF=AE=E5=A4=8Dpost=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1data=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/driver_page.py | 4 ++-- DrissionPage/session_page.py | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DrissionPage/driver_page.py b/DrissionPage/driver_page.py index fde34e2..4030d27 100644 --- a/DrissionPage/driver_page.py +++ b/DrissionPage/driver_page.py @@ -54,7 +54,7 @@ class DriverPage(BasePage): @property def html(self) -> str: """返回页面html文本""" - return format_html(self.driver.find_element_by_xpath("//*").get_attribute("outerHTML")) + return format_html(self.driver.find_element('xpath', "//*").get_attribute("outerHTML")) @property def json(self) -> dict: @@ -87,7 +87,7 @@ class DriverPage(BasePage): self._url_available = self._try_to_connect(to_url, times=retry, interval=interval, show_errmsg=show_errmsg) 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/DrissionPage/session_page.py b/DrissionPage/session_page.py index 6a22d5a..a27ba66 100644 --- a/DrissionPage/session_page.py +++ b/DrissionPage/session_page.py @@ -181,7 +181,7 @@ class SessionPage(BasePage): for _ in range(times + 1): try: - r = self._make_response(to_url, mode=mode, show_errmsg=True, **kwargs)[0] + r = self._make_response(to_url, mode=mode, data=data, show_errmsg=True, **kwargs)[0] except Exception as e: err = e r = None diff --git a/setup.py b/setup.py index e2ceeb6..31170a7 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.4", + version="1.11.5", author="g1879", author_email="g1879@qq.com", description="A module that integrates selenium and requests session, encapsulates common page operations.",