Forums

Again, Selenium Issue...

Hi. Every single day someone is having problems with Selenium and a new topic gets opened in the forum. How many times the users must state this in order for mods to take some action?

SELENIUM DOES NOT WORK CORRECTLY, AT LEAST NOT ALWAYS

There's no guarentee that your driver will be created or your driver.get() function will work seamlessly. It's based on luck. I've handled it somehow until today by nesting try catch blocks one after another. Sometimes I got lucky at the 100th try or so. Today I'm on the verge of going crazy :) I don't pay to get crazy. Do something.

  1. Don't tell me that it may be caused by the page I'm trying to access. It is not. As I said, sometimes I had to try 100 times in try catch blocks for it to work.
  2. Don't tell me I should upgrade my Selenium version. I'm already using the recommended version.

Just to be sure, what chrome_options do you set?

chrome_options = webdriver.ChromeOptions() chrome_options.add_argument("--no-sandbox") chrome_options.add_argument("--headless") chrome_options.add_argument("--disable-gpu") chrome_options.add_argument('--disable-dev-shm-usage') chrome_options.add_argument('--dns-prefetch-disable') caps = DesiredCapabilities().CHROME caps["pageLoadStrategy"] = "eager"

driver = webdriver.Chrome(desired_capabilities=caps, options=chrome_options)

https://www.awesomescreenshot.com/image/37444267?key=227f0d6f60d3cd89f902530ad0d567fc

Could you give a url so we can reproduce? (send it to support@pythonanywhere.com if you do not want to share it on the public forums)

How do you run it? Is it a task?