Posted On: Jan 11, 2021
You can use the following code to delete Cookie in Phantomjs:
if( phantom.deleteCookie('username') ) { console.log('Cookie deleted.'); } else { console.log('Cookie not deleted or does not exist.'); }
If the desired cookie is not present, the function will not generate any error, but it will return a false value.
To clear all cookies, simply use the clearCookies() function.
phantom.clearCookies();
Never Miss an Articles from us.
PhantomJS is known as a web browser without a graphical user interface. PhantomJS is a headless WebKit and web browser scriptable with a JavaScript API. Its native support for various web standards su...
PhantomJS is a headless WebKit scriptable with JavaScript which is used for web-related development workflow. Whereas Puppeteer is detailed as "Headless Chrome Node API". Basically, it is a Node libra...
The major features of Phantomjs are listed below:Page Automation Screen Capture Headless Testing Network Monitoring Ability to monitor the network connection ...