selenium.common.exceptions.WebDriverException: Message: unknown error: unable to discover open pages while test execution through InstaPy and selenium

I want to run InstaPy on windows based on this instructions so I installed it until step 3 and I'm in the advanced setup. because simple set up did'nt work for me. now i have installed GUI tool from an .exe setup file and running the bot will open a chrome page like this and after a while I get attached error bellow. what should I I do? where did I go wrong?

Im google chrome Version 68.0.3440.75 (Official Build) (64-bit) and currently I use chromedriver.exe version 2.4 and python 3.6.5

first I see this chrome page: enter image description here

and after that I see this error in GUI enter image description here the error is this

Error: ERROR [2018-07-26 11:16:27] [mohammad.f.rasoulnejad] Message: unknown error: unable to discover open pages
 (Driver info: chromedriver=2.4.226107,platform=Windows NT 6.3 x86_64)
 Traceback (most recent call last):
 File "C:\Users\Mohammad\Desktop\InstaPy\instapy\instapy.py", line 295, in set_selenium_local_session
 chrome_options=chrome_options)
 File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in __init__
 desired_capabilities=desired_capabilities)
 File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 90, in __init__
 self.start_session(desired_capabilities, browser_profile)
 File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 177, in start_session
 response = self.execute(Command.NEW_SESSION, capabilities)
 File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute
 self.error_handler.check_response(response)
 File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response
 raise exception_class(message, screen, stacktrace)
 selenium.common.exceptions.WebDriverException: Message: unknown error: unable to discover open pages
 (Driver info: chromedriver=2.4.226107,platform=Windows NT 6.3 x86_64)

 Traceback (most recent call last):
 File "C:\Users\Mohammad\Desktop\InstaPy\instapy\instapy.py", line 295, in set_selenium_local_session
 chrome_options=chrome_options)
 File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in __init__
 desired_capabilities=desired_capabilities)
 File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 90, in __init__
 self.start_session(desired_capabilities, browser_profile)
 File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 177, in start_session
 response = self.execute(Command.NEW_SESSION, capabilities)
 File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute
 self.error_handler.check_response(response)
 File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response
 raise exception_class(message, screen, stacktrace)
 selenium.common.exceptions.WebDriverException: Message: unknown error: unable to discover open pages
 (Driver info: chromedriver=2.4.226107,platform=Windows NT 6.3 x86_64)


 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
 File "quickstart.py", line 3, in <module>
 session = InstaPy(username='mohammad.f.rasoulnejad', password='myPassword')
 File "C:\Users\Mohammad\Desktop\InstaPy\instapy\instapy.py", line 188, in __init__
 self.set_selenium_local_session()
 File "C:\Users\Mohammad\Desktop\InstaPy\instapy\instapy.py", line 299, in set_selenium_local_session
 Settings.chromedriver_location))
 instapy.instapy.InstaPyError: ensure chromedriver is installed at C:\Users\Mohammad\Desktop\InstaPy\assets\chromedriver
InstaPy ended

UPDATE: I downloaded the 2.40 and placed it in assets folder but its 2.4.226107 in the error message chromedriver=2.4.226107

DevTools listening on ws://127.0.0.1:12969/devtools/browser/c5a3dd55-34fb-4723-9161-6b8a6e469b29
ERROR [2018-07-26 12:58:34] [mohammad.f.rasoulnejad]  Message: unknown error: unable to discover open pages
  (Driver info: chromedriver=2.4.226107,platform=Windows NT 6.3 x86_64)
Traceback (most recent call last):
  File "C:\Users\Mohammad\Desktop\InstaPy\instapy\instapy.py", line 295, in set_selenium_local_session
    chrome_options=chrome_options)
  File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in __init__
    desired_capabilities=desired_capabilities)
  File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 90, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 177, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: unable to discover open pages
  (Driver info: chromedriver=2.4.226107,platform=Windows NT 6.3 x86_64)

Traceback (most recent call last):
  File "C:\Users\Mohammad\Desktop\InstaPy\instapy\instapy.py", line 295, in set_selenium_local_session
    chrome_options=chrome_options)
  File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in __init__
    desired_capabilities=desired_capabilities)
  File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 90, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 177, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "D:\web\Python 3.6.5\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: unable to discover open pages
  (Driver info: chromedriver=2.4.226107,platform=Windows NT 6.3 x86_64)


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "quickstart.py", line 3, in <module>
    session = InstaPy(username='mohammad.f.rasoulnejad', password='myPassword')
  File "C:\Users\Mohammad\Desktop\InstaPy\instapy\instapy.py", line 188, in __init__
    self.set_selenium_local_session()
  File "C:\Users\Mohammad\Desktop\InstaPy\instapy\instapy.py", line 299, in set_selenium_local_session
    Settings.chromedriver_location))
instapy.instapy.InstaPyError: ensure chromedriver is installed at C:\Users\Mohammad\Desktop\InstaPy\assets\chromedriver

Upvotes: 1

Views: 999

Answers (1)

undetected Selenium
undetected Selenium

Reputation: 193298

This error message...

Message: unknown error: unable to discover open pages

...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowsing session through Chrome Browser.

Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • You are using chromedriver=2.4
  • chromedriver=2.4 is pretty old and ancient.
  • You are using Google Chrome Version 68.0.3440.75 (Official Build) (64-bit)
  • Release Notes of ChromeDriver v2.40 clearly mentions the following :

Supports Chrome v66-68

So there is a clear mismatch between the ChromeDriver v2.4 and the Chrome Browser v68.0


Solution

  • As you are using Google Chrome Version 68.0.3440.75 as per the Release Notes you need to use a compatible ChromeDriver binary.
  • Download the compatible ChromeDriver binary i.e. ChromeDriver v2.40 (2018-06-07) from ChromeDriver - WebDriver for Chrome.

Update

As you mentioned, even after upgrading to chromedriver=2.40 you still se the ChromeDriver version as chromedriver=2.4, you can override the previous version within OS PATH by explicitly mentioning the argument executable_path as follows:

from selenium import webdriver

driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe')

Upvotes: 1

Related Questions