mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
微调
This commit is contained in:
parent
af6a4e2b6e
commit
26b4d4c906
@ -197,4 +197,4 @@ def clean_folder(folder_path: str, ignore: list = None):
|
||||
if f.is_file():
|
||||
f.unlink()
|
||||
elif f.is_dir():
|
||||
shutil.rmtree(f, True)
|
||||
shutil.rmtree(f, True)
|
||||
|
@ -5,7 +5,7 @@
|
||||
@File : driver_page.py
|
||||
"""
|
||||
from glob import glob
|
||||
from time import sleep
|
||||
# from time import sleep
|
||||
from typing import Union, List, Any
|
||||
from urllib.parse import quote
|
||||
|
||||
@ -13,8 +13,8 @@ from selenium.common.exceptions import NoAlertPresentException
|
||||
from selenium.webdriver.chrome.webdriver import WebDriver
|
||||
from selenium.webdriver.remote.webelement import WebElement
|
||||
|
||||
from .common import get_loc_from_str, clean_folder, avoid_duplicate_name
|
||||
from .config import OptionsManager
|
||||
from .common import get_loc_from_str, avoid_duplicate_name # , clean_folder
|
||||
# from .config import OptionsManager
|
||||
from .driver_element import DriverElement, execute_driver_find
|
||||
|
||||
|
||||
|
@ -5,8 +5,6 @@
|
||||
@File : mix_page.py
|
||||
"""
|
||||
from typing import Union, List
|
||||
from urllib import parse
|
||||
from urllib.parse import quote
|
||||
|
||||
from requests import Response
|
||||
from requests_html import HTMLSession
|
||||
@ -159,7 +157,7 @@ class MixPage(Null, SessionPage, DriverPage):
|
||||
-> Union[bool, None]:
|
||||
"""post前先转换模式,但不跳转"""
|
||||
self.change_mode('s', go=False)
|
||||
return super().post(url, params, data, go_anyway, **kwargs)
|
||||
return super().post(url, data, go_anyway, **kwargs)
|
||||
|
||||
# ----------------重写DriverPage的函数-----------------------
|
||||
|
||||
@ -182,9 +180,6 @@ class MixPage(Null, SessionPage, DriverPage):
|
||||
|
||||
def get(self, url: str, go_anyway=False, **kwargs) -> Union[bool, None]:
|
||||
"""跳转到一个url,跳转前先同步cookies,跳转后判断目标url是否可用"""
|
||||
# to_url = quote(url, safe='/:&?=%;#@')
|
||||
# if not url or (not go_anyway and self.url == to_url):
|
||||
# return
|
||||
if self._mode == 'd':
|
||||
if super(SessionPage, self).get(url=url, go_anyway=go_anyway) is None:
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user