Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -85,8 +85,13 @@ def chrome(url:str=None,wait:int=5,header:str=None,cookie_string:str=None,cookie
|
|
85 |
driver.execute_script("window.sessionStorage.clear();")
|
86 |
driver.execute_script("window.localStorage.clear();")
|
87 |
del driver.requests
|
88 |
-
print(driver.get_cookies())
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
# 对浏览器追加我们传递进来的cookie(允许明文字符串,或者经过base64编码的json,获取json使用谷歌浏览器的Cookie-Editor插件导出json即可)
|
91 |
if type(cookie_string) == str:
|
92 |
cookie_array = convert_cookies_to_dict(header_array['cookie'])
|
|
|
85 |
driver.execute_script("window.sessionStorage.clear();")
|
86 |
driver.execute_script("window.localStorage.clear();")
|
87 |
del driver.requests
|
|
|
88 |
|
89 |
+
# 试着输出此时的浏览器数据,看是否清理干净
|
90 |
+
print(driver.get_cookies())
|
91 |
+
print(driver.execute_script("return window.sessionStorage;"))
|
92 |
+
print(driver.execute_script("return window.localStorage;"))
|
93 |
+
print(len(driver.requests))
|
94 |
+
|
95 |
# 对浏览器追加我们传递进来的cookie(允许明文字符串,或者经过base64编码的json,获取json使用谷歌浏览器的Cookie-Editor插件导出json即可)
|
96 |
if type(cookie_string) == str:
|
97 |
cookie_array = convert_cookies_to_dict(header_array['cookie'])
|