0
我正在使用Splinter和PhantonJS,我需要刪除包含給定字符串的Cookie。使用Python刪除包含Splinter中的字符串的Cookie
例如,我有一個名爲「hello」的cookie,但我不知道完整的cookie名稱。
我想過下面的代碼,但這似乎並沒有工作!
for cookie in driver.get_cookies():
if "hello" in cookie:
print "Cookie deleted";
driver.delete_cookie(cookie)
試圖在刪除前後運行打印cookie的代碼並且它不起作用,它不會刪除cookie所有 –