Load chrome extension using selenium

I did this with Python in case anyone was looking. All you have to do is download the .crx file (I used https://chrome-extension-downloader.com/) and save it somewhere that Python can access it. In my example, I imported it to the same folder as my Python script, to load exampleOfExtensionDownloadedToFolder.crx. from selenium import webdriver from selenium.webdriver.chrome.options … Read more

Get PID of Browser launched by selenium

Using the Python API, it’s pretty simple: from selenium import webdriver browser = webdriver.Firefox() print browser.binary.process.pid # browser.binary.process is a Popen object… If you’re using Chrome, it’s a little more complex, you go via a chromedriver process: c = webdriver.Chrome() c.service.process # is a Popen instance for the chromedriver process import psutil p = psutil.Process(c.service.process.pid) … Read more

How to fix selenium “DevToolsActivePort file doesn’t exist” exception in Python [duplicate]

I solve it by adding an argument –remote-debugging-port=<port> chromeOptions = webdriver.ChromeOptions() chromeOptions.add_experimental_option(“prefs”, {“profile.managed_default_content_settings.images”: 2}) chromeOptions.add_argument(“–no-sandbox”) chromeOptions.add_argument(“–disable-setuid-sandbox”) chromeOptions.add_argument(“–remote-debugging-port=9222”) # this chromeOptions.add_argument(“–disable-dev-shm-using”) chromeOptions.add_argument(“–disable-extensions”) chromeOptions.add_argument(“–disable-gpu”) chromeOptions.add_argument(“start-maximized”) chromeOptions.add_argument(“disable-infobars”) chromeOptions.add_argument(r”user-data-dir=.\cookies\\test”) b = webdriver.Chrome(chrome_options=chromeOptions) b.get(“https://google.com/”) b.quit()

Click() method will not always work

I ran into a similar issue. The click method worked on other pages, then didn’t work at all on a particular page. A race condition caused the issue: HTML content is rendered with the button disabled. The selenium web driver script was executed before the javascript onload event was triggered (Or finished executing). So the … Read more

element not interactable exception in selenium web automation

Try setting an implicit wait of maybe 10 seconds. gmail.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); Or set an explicit wait. An explicit waits is code you define to wait for a certain condition to occur before proceeding further in the code. In your case, it is the visibility of the password input field. (Thanks to ainlolcat’s comment) WebDriver gmail= … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)