I realized today that you can merge Chrome DevTools Protocol with Selenium in order to automate some very specific parts of a process within a website.
for instance: after some initial conditions have met, automate the process of uploading some files to an account and etc...
The thing is, in my original session I had some Chrome extensions added, and I know that If I were to work only with Selenium using its chromedriver.exe, I could easily add an extension (which must be compressed as a .crx file) by using the following sentence:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
opt = Options() #the variable that will store the selenium options
opt.add_extension(fr'{extension_path}')
But it seems that Chrome DevTools Protocol can't just add as much Options as Selenium, so I would have to install all my extensions in this pseudo session of mine again, no problem.
But, after installing such extensions, will those keep installed and ready for use after I execute again chrome.exe --remote-debugging-port=9222 --user-data-dir:"C:\Users\ResetStoreX\AppData\Local\Google\Chrome\User Data", and if so, where?
Or if not, does that mean that I would have to re install those every single time I need to do tests with Chrome DevTools Protocol and my Chrome extensions? Thanks in advice.
CodePudding user response:
Can confirm, a session opened with Chrome DevTools Protocol somehow stores permanently the extensions you re installed. It also remembers if you used some specific credentials for logging in to some sites.

