Ah, the key is 1. Load the login page 2. Load cookies, and add to the driver 3. Re-load dashboard/page after login. 4. DONE THANKS BROOOO. YOU SAVE MY LIFE. ❤ YOU MUST KEEP UPDATE THE PLAYLIST. I LIKE IT!!!
I'm trying to start undetectable selenium with a real session, using --user-data-dir, it loads the web, with the profile but it doesn't redirect to the get url, it just opens the browser! do you know what can happen?
Is there anyway i can log in manually and save the cookies. then load through pickle? asking this because, After login using your previous code few times Google can not sign in anymore. just says ============== Couldn’t sign you in This browser or app may not be secure. Learn more.. ============== but it worked previously. Thank
Hello @Michael Kitas Thanks for the video.Well, I always running through that error while trying to log in my website : RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase. Even though I' ve added the "if __name__ == '__main__':" line in my main file. Do you please have any idea about how to fix it?
hey i've been following your video, it's honestly great! but i'm facing an issue with svaing the cookies in the pkl file. it shows a 'cookies.pkl is not UTF-8 encoded, saving disabled' in the cookies.pkl file. i've changed the setting in chrome and also manually encoded the cookies into UTF-8 but it's still showing me the same error. can you please help me fix it?
Hey, it sounds like you're trying to open cookies.pkl in a text editor, but it's a binary file, not a text file. Don't try to change its encoding; it's meant to be used directly by your script. Use pickle.load() in your Python script to read the cookies. Ensure your script has the right permissions to write the file, and you're using the correct path. Also, check if any software like antivirus is interfering. Hope this helps
Thank you! You need to reuse cookies on the same domain you fetched them from. For example if you visited “google.com”, saved cookies then to reuse them you need to visit same domain “google.com”
Hi Michael. Great Tutorials. Do you have a way to pre-load cookies before sending the get request to the website? I tried to run the add cookies code before browser.get(). It shows invalid domain name. The reason i do this is this way behaves more like a human. 😂
No, because you need to use the cookies on the domain you logged into, and now you haven't logged in so it doesn't recognize which domain(actually none) you are on.
No, because you need to use the cookies on the domain you logged into, and now you haven't logged in so it doesn't recognize which domain(actually none) you are on.
its loging me in but with limited access, I can go to google news, docs, slides, but when i try to go to gmail or youtube I'm redirected to a login page. Any advice?
Thank you for the help, it's very appreciated. I still get captcha from the website I'm trying to scrap, but I don't know why. Is it a fair guess that a site would log my ip for some time to block me with a captcha every time I log in ?
Your welcome :) The captcha has probably to do with the IP address or it shows it either way. You can’t bypass captcha by reusing cookies. But I have made a video ep4 of this series on how to solve captchas automatically
@@MichaelKitas Well thank you for the quick reply. Actually, I went to my family's place with my laptop, and it does work without detecting anything. How funny. It's probably not the IP though, because I didn't switch proxies since I used this video 1 hour ago. So maybe restarting my computer can vscodium did activate the settings I took from your video ? I don't really know myself, I didn't change the actual scrapping code so that'll stay a mystery I guess.
Use userDataDir instead. Otherwise you are missing some cookies, you need to go to RUclips.com after log in and get them as well and then load them to the same url
You can check my previous video (Ep 6) on how to use "User data directories" there you can specify your chrome profile and you can loop through all of them as you like
Hey bro can you try to automate the facebook creator studio that was too hard to do while done everything the main problem comes in the schedule messages it was not able to scroll down. Can you please help me with that also many of us need like that, it would be helpful for us. Thank You
Here’s the function for clearing cookies: async function clearCookies(page, cookieNames = []) { try { if (cookieNames.length === 0) { // Clearing all cookies await page.evaluate(() => { document.cookie.split(';').forEach((cookie) => { const name = cookie.split('=')[0].trim(); document.cookie = `${name}=; expires=Thu, 02 Jan 2024 00:00:00 UTC; path=/;`; }); }); } else { // Clearing specific cookies await page.deleteCookie(...cookieNames); } // Cookies have been cleared successfully return true; } catch (error) { // An error occurred while clearing cookies console.error('Error clearing cookies:', error); return false; } }
Ah, the key is
1. Load the login page
2. Load cookies, and add to the driver
3. Re-load dashboard/page after login.
4. DONE
THANKS BROOOO. YOU SAVE MY LIFE. ❤
YOU MUST KEEP UPDATE THE PLAYLIST. I LIKE IT!!!
Awesome tutorial, this is the first method I've found that actually works!
BRO, I FUCKING LOVE YOU, YOU SAVED ALL MY WORK AND HELPED ME A LOT. I LOVE YOU!!! THANKS FOR THAT VIDEO!!!
you sir are a god amongst ants. ty
great work Michael!
I'm trying to start undetectable selenium with a real session, using --user-data-dir, it loads the web, with the profile but it doesn't redirect to the get url, it just opens the browser! do you know what can happen?
Does it show any errors?
This video helped me a lot,thanks!
You saved my day bro, Great work!
Is there anyway i can log in manually and save the cookies. then load through pickle?
asking this because,
After login using your previous code few times Google can not sign in anymore.
just says
==============
Couldn’t sign you in
This browser or app may not be secure. Learn more..
==============
but it worked previously.
Thank
Maybr create a script which saves cookies after a specific timeout, within that timeout login manually while of course you are using the script
Hello @Michael Kitas
Thanks for the video.Well, I always running through that error while trying to log in my website :
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
Even though I' ve added the "if __name__ == '__main__':" line in my main file.
Do you please have any idea about how to fix it?
Can you copy paste that part from my code and check again?
Hello sir, I wanted to ask a question that how to store multiple cookies in aa text file and login them all using for i in range:
The same way I save them and use them, you use the same functionality
hey i've been following your video, it's honestly great! but i'm facing an issue with svaing the cookies in the pkl file. it shows a 'cookies.pkl is not UTF-8 encoded, saving disabled' in the cookies.pkl file. i've changed the setting in chrome and also manually encoded the cookies into UTF-8 but it's still showing me the same error. can you please help me fix it?
Hey, it sounds like you're trying to open cookies.pkl in a text editor, but it's a binary file, not a text file. Don't try to change its encoding; it's meant to be used directly by your script. Use pickle.load() in your Python script to read the cookies. Ensure your script has the right permissions to write the file, and you're using the correct path. Also, check if any software like antivirus is interfering. Hope this helps
@michael Kitas Sir How Can I extend the Expiry Date of the Cookie With the PKL file On Execution with For Loop
You can't extend the expiry date of a cookie that is already created
Hi, thank you for your videos, they are very helpful. Is it safe to use Undetectable ChromeDriver to store my credentials and cookies?
Sure, though not sure what you mean by safe, that doesn't depend on the chromedriver itself.
@@MichaelKitas I mean if I will use my main creds for gmail, etc, there is no way that undetectable driver can send them somewhere?
@@vladislavberestenko5392 It doesn't contain malware if that's what you mean
@@MichaelKitas Thank you
really awesome!!! here what I found many times
Awesome brother... Love your videos
Excellent video! I But I got an error for 'invalid cookie domain' and tells me the session info. Do you know how can I fix this problem?
Thank you! You need to reuse cookies on the same domain you fetched them from. For example if you visited “google.com”, saved cookies then to reuse them you need to visit same domain “google.com”
Perfect.
I need it for my bot
Hi Michael. Great Tutorials. Do you have a way to pre-load cookies before sending the get request to the website? I tried to run the add cookies code before browser.get(). It shows invalid domain name. The reason i do this is this way behaves more like a human. 😂
No, because you need to use the cookies on the domain you logged into, and now you haven't logged in so it doesn't recognize which domain(actually none) you are on.
No, because you need to use the cookies on the domain you logged into, and now you haven't logged in so it doesn't recognize which domain(actually none) you are on.
It works! Thanks bro!
Very Innovative
Thankyou it worked for me
its loging me in but with limited access, I can go to google news, docs, slides, but when i try to go to gmail or youtube I'm redirected to a login page. Any advice?
Gmail uses a different domain for cookies, you can use a user data directory instead.
Hi Vinny, did you solve this???
For websites that required a one time sms code to login, at what point should the cookies be saved?
When you have successfully logged in
sir i wanted a code for changing proxies from a text file and checking proxies and then assign them to the undetected chromedriver
I will make a video on that soon 👍
Thank you for the help, it's very appreciated. I still get captcha from the website I'm trying to scrap, but I don't know why. Is it a fair guess that a site would log my ip for some time to block me with a captcha every time I log in ?
Your welcome :) The captcha has probably to do with the IP address or it shows it either way. You can’t bypass captcha by reusing cookies. But I have made a video ep4 of this series on how to solve captchas automatically
@@MichaelKitas Well thank you for the quick reply. Actually, I went to my family's place with my laptop, and it does work without detecting anything. How funny. It's probably not the IP though, because I didn't switch proxies since I used this video 1 hour ago. So maybe restarting my computer can vscodium did activate the settings I took from your video ? I don't really know myself, I didn't change the actual scrapping code so that'll stay a mystery I guess.
can we use this method to reuse the session on whatsapp web?
Yeah, or you can use userDataDir as well
thank you very much, it works perfect. but if i want to go to youtube i am not logged in anymore, how can i do it?
Use userDataDir instead. Otherwise you are missing some cookies, you need to go to RUclips.com after log in and get them as well and then load them to the same url
I might do a video on that since many people requested it
How about multiple google chrome profile? Every time task was done it loads another chrome profile with the different google account
You can check my previous video (Ep 6) on how to use "User data directories" there you can specify your chrome profile and you can loop through all of them as you like
It worked thanks
Thanks for Tutorial
But I have a question. How can we scrape data save in the database?
I have made episode 1,2,3 about how to scrape data, which you can combine with my MongoDB tutorial series: ruclips.net/video/DjlXcwUQTMY/видео.html
@@MichaelKitas ❤
This is not working for me. I used the same code. However, I am not able to logged in to google.
When I run the load cookies. It is navigated to google but no logged in. Please help me with the same. Thanks
Use user data dir instead
Nice video, it works for me. My problem now is that I can just use the cookie once, if I try to reuse, it I will not login
It should, does it not work with a specific service?
You saved my day . Thank you...
Can you Please do a video on how to bypass DataDome anti-bot protection.
Will check it out and possibly make a video, thank you for the idea.
Hey bro can you try to automate the facebook creator studio that was too hard to do while done everything the main problem comes in the schedule messages it was not able to scroll down. Can you please help me with that also many of us need like that, it would be helpful for us.
Thank You
Not sure what scrolling issue you are referring to. How is this related to cookies?
@@MichaelKitas i am so sorry it was finished that work
Hello, its possible to revoke all the cookies?
Here’s the function for clearing cookies:
async function clearCookies(page, cookieNames = []) {
try {
if (cookieNames.length === 0) {
// Clearing all cookies
await page.evaluate(() => {
document.cookie.split(';').forEach((cookie) => {
const name = cookie.split('=')[0].trim();
document.cookie = `${name}=; expires=Thu, 02 Jan 2024 00:00:00 UTC; path=/;`;
});
});
} else {
// Clearing specific cookies
await page.deleteCookie(...cookieNames);
}
// Cookies have been cleared successfully
return true;
} catch (error) {
// An error occurred while clearing cookies
console.error('Error clearing cookies:', error);
return false;
}
}
Whats the Theme name of your Vs Code
Bearded Theme - Arc
sir can you tell about proxy rotation from txt
I will make a video on that soon 👍
How to multiple run browser profile spesifik ?
I am going to make a video on that soon
@@MichaelKitas thanks , i wait
How long can this reuse cookies be used to long in a website
Each cookie has they’re own expiration date, depends on how long they want the cookie to be working until you have to for example login again
@@MichaelKitas Hmm I see thank you