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.",