mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修复设置cookies时域名不对应时出现的问题
This commit is contained in:
parent
d9281914dd
commit
1c032a0a5d
@ -288,7 +288,13 @@ def is_cookie_in_driver(page, cookie):
|
|||||||
:param cookie: dict格式cookie
|
:param cookie: dict格式cookie
|
||||||
:return: bool
|
:return: bool
|
||||||
"""
|
"""
|
||||||
for c in page.get_cookies():
|
if 'domain' in cookie:
|
||||||
if cookie['name'] == c['name'] and cookie['value'] == c['value']:
|
for c in page.get_cookies(all_domains=True):
|
||||||
return True
|
if cookie['name'] == c['name'] and cookie['value'] == c['value'] and cookie['domain'] == c.get('domain',
|
||||||
|
None):
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
for c in page.get_cookies(all_domains=True):
|
||||||
|
if cookie['name'] == c['name'] and cookie['value'] == c['value']:
|
||||||
|
return True
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user