I want to clear everything that is either stored in the temple, conditionally how to enter ctrl+h to clear cookies and the session
async def Clear_Page(self):
try:
await self.browser.contexts[0].pages[0].goto(check_site_url)
try:
await self.browser.contexts[0].clear_cookies()
await self.browser.contexts[0].pages[0].evaluate('localStorage.clear();')
await self.browser.contexts[0].pages[0].evaluate('sessionStorage.clear();')
except Exception as S:
print('s ' + str(S))
await self.browser.contexts[0].pages[0].reload()
return True
except Exception as A:
print(A)
return False
But this code doesn’t work properly and I’m still logged in.