mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-11-29 10:37:35 +08:00
微调
This commit is contained in:
parent
ef577a9131
commit
415747731c
@ -300,10 +300,10 @@ def set_browser_cookies(page, cookies):
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if not page._browser_url.startswith('http'):
|
||||
url = page._browser_url
|
||||
if not url.startswith('http'):
|
||||
raise RuntimeError(f'未设置域名,请设置cookie的domain参数或先访问一个网站。{cookie}')
|
||||
|
||||
ex_url = extract(page._browser_url)
|
||||
ex_url = extract(url)
|
||||
d_list = ex_url.subdomain.split('.')
|
||||
d_list.append(f'{ex_url.domain}.{ex_url.suffix}' if ex_url.suffix else ex_url.domain)
|
||||
|
||||
|
@ -167,7 +167,7 @@ class Listener(object):
|
||||
caught = 0
|
||||
end = perf_counter() + timeout if timeout else None
|
||||
while True:
|
||||
if timeout and perf_counter() > end:
|
||||
if (timeout and perf_counter() > end) or self._driver._stopped.is_set():
|
||||
return
|
||||
if self._caught.qsize() >= gap:
|
||||
yield self._caught.get_nowait() if gap == 1 else [self._caught.get_nowait() for _ in range(gap)]
|
||||
|
@ -62,7 +62,7 @@ After long-term practice, the author has stepped through countless pitfalls, and
|
||||
|
||||
This library uses a fully self-developed kernel, has built-in N number of practical functions, and has integrated and optimized common functions. Compared with selenium, it has the following advantages:
|
||||
|
||||
- No webdriver features
|
||||
- Not base on webdriver
|
||||
- No need to download different drivers for different browser versions
|
||||
- Runs faster
|
||||
- Can find elements across `<iframe>` without switching in and out
|
||||
|
Loading…
Reference in New Issue
Block a user