2

First of all I looked for solution to this problem on the internet already but nothing seemed to work. When I am running my program it opens and closes selenium driver multiple times but sometimes I get error:

selenium.common.exceptions.WebDriverException: Message: unkown error: unable to discover open pages

I have the latest version of Chrome and matching chromedriver.exe downloaded. This is the code that opens drivers (it is in loop so it is always the same):

opts = webdriver.ChromeOptions()
opts.add_argument("--disable-notifications")
opts.add_argument("--headless")
opts.add_argument("--log-level=3")
opts.add_argument("--no-sandbox")
driver = webdriver.Chrome(executable_path=r"pathToChromedriver.exe", options=opts)

I added --no-sandbox argument because someone on StackOverflow said that it worked for them but it did not for me.

I am new to this so if any more code or other information is needed please let me know in the comments.

EDIT: I ran the code on my other computer and it worked fine (code has not got errors in it), but I would still like to know why it does not work on the other one.

0 Answers0