Closed erickythierry closed 3 years ago
Yes, that's because you created a new chrome profile in your specified directory. But you don't need that if you only want to store a WhatsApp Web Session. WhatsApp stores the data for the session in local storage and/or (depending on what method they are using, they sometimes mix it up) IndexedDB. So you need a method to get data from those two storages and a method to inject it in there again.
If you want to use my script, you could easily save yourself the extra effort of writing that yourself and just import my SessionHandler class to your script.
I have a project that uses selenium to automate whatsapp, but one of the problems I've been facing is that chrome ends up creating a lot of cache files in the folder where it saves the session (about 500mb). that your script can save the whatsapp session and then restore it without all that extra chrome cache?
a piece of selenium code below
I point a folder to chrome to save the data and so I can recover the whatsapp session, but these extra chrome files end up hurting the project's performance after a few days running ...