This commit is contained in:
g1879 2020-06-13 23:38:17 +08:00
parent af6a4e2b6e
commit 26b4d4c906
3 changed files with 5 additions and 10 deletions

View File

@ -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)

View File

@ -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

View File

@ -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