removeprefix for www. is required here

This commit is contained in:
Patrick Robertson
2025-03-21 12:21:56 +04:00
parent 4b5a8c0199
commit aacb874b56

View File

@@ -48,7 +48,7 @@ class CookieSettingDriver(webdriver.Firefox):
for name, value in cookie.split("="):
self.driver.add_cookie({"name": name, "value": value})
elif self.cookie_jar:
domain = urlparse(url).netloc
domain = urlparse(url).netloc.removeprefix("www.")
regex = re.compile(f"(www)?.?{domain}$")
for cookie in self.cookie_jar:
if regex.match(cookie.domain):