fix: recognize current cookie consent labels

Expand only the `_dismiss_cookie_banner()` exact-match label tuple to recognize `Accept All Cookies` and `Accept all cookies`, fixing issue #21 without changing OAuth, Turnstile, timing, browser, logging, or click behavior.
This commit is contained in:
Aaron Liang
2026-07-20 23:49:53 +08:00
committed by GitHub
parent 4b030214d9
commit dfa204194f
+8 -1
View File
@@ -174,7 +174,14 @@ def _cookie_banner_visible(text: str) -> bool:
def _dismiss_cookie_banner(page: Any, log: LogFn) -> bool: def _dismiss_cookie_banner(page: Any, log: LogFn) -> bool:
for label in ("全部允许", "Allow all", "接受", "Accept"): for label in (
"全部允许",
"Allow all",
"Accept All Cookies",
"Accept all cookies",
"接受",
"Accept",
):
if _click_exact(page, [label], log, real=True): if _click_exact(page, [label], log, real=True):
log("cookie banner dismissed: %s" % label) log("cookie banner dismissed: %s" % label)
return True return True