YOU'RE MY FKING HERO! I've been grinding the whole damn day trying to interact with the same webdriver session and to no results, until you showed how it's done... I've done some tweaks of course, I do everything inside my python code, no console required, BUT without you I couldn't have done NOTHING. Thank you again.
Let Me tell You. I love hearing Your voice Mukesh. So concise, so beautiful. I almost remember Cherry Blossoms while I was watching this video. So good. So so good~ xFredAgain&Again I cannot tell You that if I could just hear You. Explain. The Code. SANK YIOUUU SIIIR 😊🎉
Thanks for the video, btw: Do you know if CloudFlare DDoS protection will redirect correctly if it gets executed when doing tests using this method shown in the video? I ask because when you use the chromedriver even with user data dir and profile directory, after several tests CloudFlare DDoS protection appears and it doesn't redirect you because it thinks you are a bad bot that wants to shut down the website in which you are doing tests, please let me know if this doesn't happen when using this method.
Very thankful! Is it also possible to execute the Selenium script on an already opened browser, but headless? Meaning, that the browser's window won't pop up?
Sir, can you please say why did you take remote-debugging-port (8989) instead of (9222) which is shown on Chrome Devtools Protocal... What port number should I take
works great if you have only 1 browser instant open for that account but what about if you have many accounts open...can we access that specific instance?
This is so great, thank you. Is there a way to also include the first part into the script? I mean that instead of going to "cmd" and manually inputing all the "-- remote-debuggin-port" we can also include that in the script somehow?
You can add this to your code: import shlex, subprocess subprocess.Popen(shlex.split(r''' FIRST PART ''')) Or also you can put it in a .bak before the "start python file.py"
Hello sir how can i do login multiple Facebook ids in multiple chrome profile and these login ids save for me if i opened these chrome profile than open Facebook that ids will be open how can i do that ???
can you please tell me how can I attach this session to one of my profile because I need to enable extension but on the fly it takes time, does it possible?
hello, I tried to do as you said, and it worked for about a week but all of a sudden python just isnt going to the opened chrome tab, I updated my webdriver and made sure it is in line with my chrome version and it works without options. cmd: cd C:\Program Files\Google\Chrome\Application chrome.exe --remote-debugging-port=8989 -user-data-dir="C:\Users\Mac\Desktop\Drive D\MJ\Python\chromeprofile" in python: opt = Options() opt.add_experimental_option("debuggerAddress", "localhost:8989") driver = webdriver.Chrome(options=opt) please help, very much appreciated
It was great video but i was thinking can we open the browser which we opened manually in which already all cookies are stored which helps us bypass login option?
Hello, what if o want open a new brownser, and get logged in, after that I want open a new browser but with the same session (that remain logged in) , how can I do it? I want be logged in two different windows of same browser and be managed each window with different parts of script
if we wanted the same result, but not on the existing tab. but a new tab should open on the already window and execute the script. can anyone help please?
Hi Mukesh, In the start i got error likr"DeprecationWarning: use options instead of chrome_options". so i tried using options but ended with following error. selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at localhost:8080 from chrome not reachable.
Previously i was using "chrome.exe --remote-debugging--port=8080 --user-data-dir="C:\Drivers\ChromeData"" But i use the following cmd line to open a chrome in debugger mode , i am able to proceed. chrome.exe --remote-debugging-port=8080 --no-first-run --no-default-browser-check --user-data-dir="C:\Drivers\ChromeData"
Hello, you opened the browser in cmd, how can i open like this but in a python code? i mean like: my code open the chrome in debug mode and after connect
Hi Ninjamoshi, Official link chromedriver.chromium.org/capabilities Please find below code ChromeOptions options = new ChromeOptions(); Map prefs = new HashMap(); prefs.put("download.default_directory", "/directory/path"); options.setExperimentalOption("prefs", prefs);
please how can i use it (chromiun --remote-debuggin-port=9105 --user-data-dir='/home/olix/Desktop/data9105') in linux but have it stay like it is on windows even if i close terminal. ??? thanks for answer.
@@Mukeshotwani thank you for your answer you are a good person. what I would like to know is how to do to keep the session in linux if I want to close the terminal or is it impossible to do? thank you.
How to open a link from signed in chrome profile using selenium python. I googled and didn't found the correct way to do that. Your help would be great. Thanks
For selenium 4.10.0+ executable_path was removed and need to use a service from selenium.webdriver.chrome.service import Service service = Service(executable_path='./chromedriver.exe') options = webdriver.ChromeOptions() driver = webdriver.Chrome(service=service, options=options) ^if you make the above changes it will work
by using jupyter notebook or something similar you can easily execute code line by line thus you don't have to comment previous lines. In my use case I wanted to make a web bot which involved a lot of trial and error and loading session each time was pain in the ass.
Hi Mukesh , Very clearly explained. I am trying to save cookies for already logged in session in python and trying to use it for every instance of web driver to get rid of login but i am not able to achieve it, can you please do a small video on this
Hi man thanks for your support, i followed your steps and did the same code but when i run the code with the browser closed its give me this error : "selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at localhost:8989 from chrome not reachable" but when i run the chrome.exe pointing to the session from the console i can open the session created normaly. Looking forward for more videos, thanks again!
Hello sir can you make video on multiple facebook ids auto login on Facebook with chrome users. i have multiple facebook ids likes thousands of ids and i am tried to login in making new chrome user and login and this will take much time from can you tell me plz humble request ??
This worked for me for a few days. But now it gives me and error saying: selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at localhost:9222 from session not created: This version of ChromeDriver only supports Chrome version 91 Current browser version is 93.0.4577.82
Please help I got this error. Do you know how to fix it? driver = webdriver.chrome(executable_path= "C:\\Users\\PC-home\\Documents\\Dan\\chromedriver.exe" , chrome_options = opt) TypeError: 'module' object is not callable
YOU'RE MY FKING HERO! I've been grinding the whole damn day trying to interact with the same webdriver session and to no results, until you showed how it's done... I've done some tweaks of course, I do everything inside my python code, no console required, BUT without you I couldn't have done NOTHING. Thank you again.
I've been getting a deprecation warning, do you know any solution?
@@juanpablomessmer2630 same here did you get any solution ?
From Nigeria 🇳🇬, you are amazing.....This solved a lot of problems
Yo what project are you using selinium for
I've been looking for couple of days for thinking this, you're definitely a live saver. Thanks sir for your kind sharing
You are most welcome
Very Nice, saved huge amount of time with simple steps to introduce.
nice
Man, I would watch this guy code the whole day!
I must say it's a Life saving hack. Thanks a lot and really appreciate for demonstrating in Python.
Glad you liked it! Godwin. Cheers
nice
hey can you give me source code im getting errors
You saved my life, the Selenium visual Chrome driver cannot show some image file frome web, thank you.
Most welcome Sub
can you please share the code?
Omg.... you saved me so much time. THANK YOU!!!
Looking forward for more videos on python sir thank u mukesh..
Love this channel 👍🏻👍🏻👍🏻
Glad you liked it! Thanks Gulshan
Quality Content, precise You rock mannnn solved my problem of login cookie
GOD! Thank you for this tutorial! 🏆
I am glad it helped
Very clear explanation brother. thanks a lot
Thanks Aswin
Let Me tell You. I love hearing Your voice Mukesh. So concise, so beautiful. I almost remember Cherry Blossoms while I was watching this video. So good. So so good~ xFredAgain&Again I cannot tell You that if I could just hear You. Explain. The Code. SANK YIOUUU SIIIR 😊🎉
Great video, helped me out a lot!
Awesome, thank you!
Thanks for the video, btw: Do you know if CloudFlare DDoS protection will redirect correctly if it gets executed when doing tests using this method shown in the video? I ask because when you use the chromedriver even with user data dir and profile directory, after several tests CloudFlare DDoS protection appears and it doesn't redirect you because it thinks you are a bad bot that wants to shut down the website in which you are doing tests, please let me know if this doesn't happen when using this method.
Thanks for showing us a working solution!
loved the fact that it is available on python also
Yes I am loving this too.
Thank, you Sir. Really appreciate your effort.
You are most welcome Chetan.
Amazing. Thank you very much for this awesome tutorial.
nice
Cool
Could you reply, how to run tasks in headless mode using this?
Can i use with firefox browser ? If its possible, can u make a video teaching us ?
Will try
Very thankful! Is it also possible to execute the Selenium script on an already opened browser, but headless? Meaning, that the browser's window won't pop up?
Interesting but not tried. You can use --headless=new for the same. Here is the video ruclips.net/video/_j0S9Fbs3dY/видео.html
I am trying to make a whatsapp bot. but web needs a registration right after opening the window. so I needed this buddy. thx
Great Orhan, I am glad it helped.
Sir, can you please say why did you take remote-debugging-port (8989) instead of (9222) which is shown on Chrome Devtools Protocal... What port number should I take
You can use any port number you can use 8989 or 9222 you just have to the same in program.
@@Mukeshotwani Thank You
Nice video sir❤️❤️❤️❤️❤️❤️
Thanks Mate
Great content! Thanks bro!
Glad you liked it! Thanks Mate
Thanks a lot! It was very helpfull!
2:25 why did u change protocol from 9222 to 8989?
You can use any port and make sure you use same port number is code as well. I have 8989 is my code too.
Great tutorial! How can i download the chrome driver shown at 6:50?
works great if you have only 1 browser instant open for that account but what about if you have many accounts open...can we access that specific instance?
Thanks much for doing with python.
So for me I want to do a script that is automated to do some scraping, but how I can automate the part of cmd?
Using batch command or shell
Great sir, Is there any github link for the code ?? I had'nt found in description.
This is so great, thank you. Is there a way to also include the first part into the script? I mean that instead of going to "cmd" and manually inputing all the "-- remote-debuggin-port" we can also include that in the script somehow?
You can add this to your code:
import shlex, subprocess
subprocess.Popen(shlex.split(r''' FIRST PART '''))
Or also you can put it in a .bak before the "start python file.py"
Mukesh, is it possible to explain/comment on this question?
you can use pyautogui to do that part by gui automation
Yes make a bat file and then include in your program using subprocess module
i think , os module has a class that inputs cmd commands
Hello sir how can i do login multiple Facebook ids in multiple chrome profile and these login ids save for me if i opened these chrome profile than open Facebook that ids will be open how can i do that ???
I use to update my profile inevery 5 minutes on a local job platform, Thank Yoıu
hello there, did this method worked with you,
selenium keep getting stuck at my end
Awesome Yasin
Hey Peter, what issues you are getting here.
can you please tell me how can I attach this session to one of my profile because I need to enable extension but on the fly it takes time, does it possible?
Sorry mate, this I have not tried.
@@Mukeshotwani thank you so much for your reply. Is that possible that we can run the session with an extension enabled.
hello, I tried to do as you said, and it worked for about a week but all of a sudden python just isnt going to the opened chrome tab, I updated my webdriver and made sure it is in line with my chrome version and it works without options.
cmd:
cd C:\Program Files\Google\Chrome\Application
chrome.exe --remote-debugging-port=8989 -user-data-dir="C:\Users\Mac\Desktop\Drive D\MJ\Python\chromeprofile"
in python:
opt = Options()
opt.add_experimental_option("debuggerAddress", "localhost:8989")
driver = webdriver.Chrome(options=opt)
please help, very much appreciated
Same is possible with IE ?
Hi bro this code is not working chrome version 117. Could you please help us with this version?
awesome . thank you . you are nice man bro. xxxx
Always welcome Hakan
It was great video but i was thinking can we open the browser which we opened manually in which already all cookies are stored which helps us bypass login option?
moreover how to perform this action on linux, as i am a newbie.
Hey Shuham once you open browser using DevTools you can login which will have session active, then you can use the same.
Hello, what if o want open a new brownser, and get logged in, after that I want open a new browser but with the same session (that remain logged in) , how can I do it? I want be logged in two different windows of same browser and be managed each window with different parts of script
Can this be done in firefox? Not sure if it has the dev tools
great, it really helps
Thank you
if we wanted the same result, but not on the existing tab. but a new tab should open on the already window and execute the script. can anyone help please?
Hi Raj, not tried this. You might have to do some R&D here.
how can i open slenium browser window at client(user) side in selenium with python when I hit go button on my auto login system?
Hey Mukesh, can you do the same thing using robotframework?
Hi Mukesh,
In the start i got error likr"DeprecationWarning: use options instead of chrome_options". so i tried using options but ended with following error.
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at localhost:8080
from chrome not reachable.
Previously i was using "chrome.exe --remote-debugging--port=8080 --user-data-dir="C:\Drivers\ChromeData""
But i use the following cmd line to open a chrome in debugger mode , i am able to proceed.
chrome.exe --remote-debugging-port=8080 --no-first-run --no-default-browser-check --user-data-dir="C:\Drivers\ChromeData"
Great Minati thank you for updating.
thank you so much
Thanks for sharing
Hello, you opened the browser in cmd, how can i open like this but in a python code? i mean like: my code open the chrome in debug mode and after connect
use Cython.
Bro you are a fucking GOAT. no way bro you are the one who saved my life. thankyou so much bhai.
Thank you so much it means alot to me.
Thanks Mukesh!! Is there a way to use selenium on Chrome with the Chrome extensions already installed?
just use specific profile where it was installed.
@@mrnobody_23 how to?? how to use user profiles where i have already logged in??
hello sir nicely explained....can u plz explain how to run the session in an already logged in account???
Hi Fringe, it only works with chrome started by CDP commands.
Wondering the same thing as @fringe, can you elaborate a little bit more please?
How would you do this exact same thing on a Mac? I’m having trouble setting up the local host.
Any help is appreciated, thanks!
cooool!!! internet rebellion time!
Please create a complete playlist for framework development in selenium-python.
Hi Nasir, sure will do soon.
It was nice and easy.
Thanks Rahman
Hey Mukesh ! I wish to make the same process in Firefox. Can you tell me small steps in the comment plz.
Hi Malik, I will try for FF as well if possible.
Nice really appreciated
I am glad it helped.
how can we change the download director to download files to a specific folder?
Hi Ninjamoshi,
Official link chromedriver.chromium.org/capabilities
Please find below code
ChromeOptions options = new ChromeOptions();
Map prefs = new HashMap();
prefs.put("download.default_directory", "/directory/path");
options.setExperimentalOption("prefs", prefs);
@@Mukeshotwani hi sir can give an example regarding the same ? like make video or a blog
using python
also can ou change the download path On Already Opened Browser?
please how can i use it (chromiun --remote-debuggin-port=9105 --user-data-dir='/home/olix/Desktop/data9105') in linux but have it stay like it is on windows even if i close terminal. ???
thanks for answer.
Once you close the terminal it will close the session.
@@Mukeshotwani thank you for your answer you are a good person. what I would like to know is how to do to keep the session in linux if I want to close the terminal or is it impossible to do? thank you.
In this code I need to manually type the username, password and two factor auth, after that code should run. what to do?
is there any way to open in firefox also in this same method
sir its showing error
No pyvenv.cfg file
Any Idea how do we remote debug from a host computer to remote computer using webdriver.Remote(command_executer=:port) instead of webdriver.Chrome()
fantastic!! how could i use remote debugging with proxy ?
How to open a link from signed in chrome profile using selenium python. I googled and didn't found the correct way to do that. Your help would be great.
Thanks
Hi Gowtham, you can start default user profile.
@@Mukeshotwani can you guide me how
Thanks for the new learning
Not working for selenium 4. Is there any solution for this problem in selenium 4?
For selenium 4.10.0+
executable_path was removed and need to use a service
from selenium.webdriver.chrome.service import Service
service = Service(executable_path='./chromedriver.exe')
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)
^if you make the above changes it will work
@@NayyarAbbas-sh1vw thanks dude I will try it out
for firefox
what i have to do bro
thanks man it worked!
You're welcome! Cheers
I can't get it working, Nothing is happening in the browser.
can i use headless mode?
by using jupyter notebook or something similar you can easily execute code line by line thus you don't have to comment previous lines.
In my use case I wanted to make a web bot which involved a lot of trial and error and loading session each time was pain in the ass.
Noted Sir.
Hi Mukesh , Very clearly explained.
I am trying to save cookies for already logged in session in python and trying to use it for every instance of web driver to get rid of login but i am not able to achieve it, can you please do a small video on this
Are you able to resolve this
Nope
@@krishnachaitanya836 : can i get your number to discuss few things
sir please make a video same for Internet Explorer,
Hi man thanks for your support, i followed your steps and did the same code but when i run the code with the browser closed its give me this error :
"selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at localhost:8989 from chrome not reachable"
but when i run the chrome.exe pointing to the session from the console i can open the session created normaly. Looking forward for more videos, thanks again!
did you solve this? Getting the same error.
im getting the same error too
did your problem slove? can you give source code?
thanks for this tutorial , this can it run with firefox
hello sir, Can we run this code on multiple open drivers?
Hi Veenay it works on specific browser with port.
@@Mukeshotwani Ok thank you so much, I'll mail you regarding one small query if you can help.
Is there other way to connect already opened browser without using remote debugging port? 🤔
Does it work on mac as well ?
Yes Caner why not.
Hello Sir, How to achieve this in macbook? Can you please guide me.
Can we able to do it in Robot Framework
Egerly waiting for your reply
Hi Arka, why not.Initial steps are same then we need to pass desired capability robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Open%20Browser
How to do this in firefox browser as experimental_option debuggerAddress is not present. If anyone know help me out...
can you make a tutorial or send some code on how to do this in JS? ive been beating my head for three days trying to figure it out
Can you do the tutorial in robotframework?
this tutorial is lit
thankyou
others had java n shit
but I love Python
Hi Aadesh + 1
@@Mukeshotwani ❤️
can we open another tab in this existing window
i tried with driver.execute_scripts("window.open();"), but didn't work
how to achieve this thing for edge
sir but without command proamt how can we use
Hello sir can you make video on multiple facebook ids auto login on Facebook with chrome users. i have multiple facebook ids likes thousands of ids and i am tried to login in making new chrome user and login and this will take much time from can you tell me plz humble request ??
This worked for me for a few days. But now it gives me and error saying: selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at localhost:9222
from session not created: This version of ChromeDriver only supports Chrome version 91
Current browser version is 93.0.4577.82
How to do this on Javascript :(
?
Please help I got this error. Do you know how to fix it? driver = webdriver.chrome(executable_path= "C:\\Users\\PC-home\\Documents\\Dan\\chromedriver.exe" , chrome_options = opt)
TypeError: 'module' object is not callable
how to setup this for mac
Tks from Brasil!! o/
Welcome from India
sir how we can do this same with mozilla firefox??
I havent tried on FF
nice 👍
Thanks mate
getting error please anyone help!!
'''DeprecationWarning: use options instead of chrome_options
driver = webdriver.Chrome(executable_path="F:\\top secret\\chromedriver.exe", chrome_options=opt)'''
How to do it for Edge?
Hi Nancy, you can start edge as well in cdp mode and follow the current video.
@@Mukeshotwani but edge options doesn’t have the function to add experimental options