Open TonyLiooo opened 1 month ago
@ultrafunkamsterdam I found the problem. It was because 'partitionKey' was just the URL, which caused 'get_cookies' to hang. The improvement can be done as follows:
class CookiePartitionKey:
@classmethod
def from_json(cls, json_input) -> CookiePartitionKey:
if isinstance(json_input, str):
return cls(
top_level_site=json_input,
has_cross_site_ancestor=False
)
elif isinstance(json_input, dict):
return cls(
top_level_site=str(json_input["topLevelSite"]),
has_cross_site_ancestor=bool(json_input["hasCrossSiteAncestor"])
)
OMG You are a savior! I was struggling for 4 days trying to fix it!
All the cookies on the website are HttpOnly. Using await tab.send(cdp.storage.get_cookies()) causes it to hang indefinitely.