How to clean cache and cookies in Selenium using PhantomJS in Python? -
i using selenium phantomjs webdriver on python 2.7 , don't see references in documentation cleaning cache. there way clean cache , cookies? have seen functions in phantomjs can it, how use them in selenium ?
try this:
driver.get("about:blank") driver.delete_all_cookies() driver.execute_script('localstorage.clear();')
i put driver.get("about:blank") in there in case current site has changed javascript environment in unexpected ways.
you destroy driver , create new one, might less efficient (you'd have measure on setup know sure).
Comments
Post a Comment