4

I have a script which uses selenium for testing. Now even opening a Google page using

driver.get(url) # url = Google homepage url

is giving me below error

driver.get("https://my.gumtree.com/login")
File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 245, in get
self.execute(Command.GET, {'url': url})
File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 233, in execute
self.error_handler.check_response(response)
File "C:\Python34\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot determine loading status
from unknown error: missing or invalid 'entry.level'
(Session info: chrome=65.0.3315.3)
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.16299 x86_64)

I have Google chrome version 65, Chromedriver 2.35 and selenium 2.53.1

I tried different version combinations(mentioned in below table) as per solutions mentioned in other similar questions but nothing worked.

Selenium      Chrome      Chromedriver
2.53.0        63           2.33
2.53.1        65(latest)   2.34
3.6.0                      2.35(latest)
3.7.0
3.8.0
3.8.1(latest)

EDIT 1: JDK version

java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
3
  • selenium 2 is very outdated.. get on 3.x Commented Jan 12, 2018 at 19:19
  • Thank you for pointing out, it was a typo mistake. I have edited the question. Commented Jan 12, 2018 at 22:39
  • You error output suggests that you are still using chromedriver=2.29.461591. If you choose to use the most recent browser version with the most recent Selenium , make sure you are using the latest driver version too. Commented Jan 15, 2018 at 2:49

5 Answers 5

7

The error says it all :

selenium.common.exceptions.WebDriverException: Message: unknown error: cannot determine loading status
from unknown error: missing or invalid 'entry.level'

Your main issue is the version compatibility among the binaries you are using as follows :

  • You are using chromedriver=2.29.461591 (which is as per the logs, though you mentioned Chromedriver 2.35 in your question)
  • Release Notes of chromedriver=2.29.461591 clearly mentions the following :

Supports Chrome v56-58

  • You are using chrome=65.0.3315.3
  • Release Notes of chromedriver=2.35 clearly mentions the following :

Supports Chrome v62-64

  • You are using Selenium Version 2.53.1.
  • Your JDK version is unknown to us.

Solution

  • Upgrade JDK to recent levels JDK Version 8 Update 151.
  • Upgrade ChromeDriver to ChromeDriver v2.35 level.
  • Keep Chrome to Chrome v64.x levels. (as per ChromeDriver v2.35 release notes)
  • Upgrade Selenium to current levels Version 3.8.1.
  • Clean the Project Workspace from your IDE & Rebuild All.
  • Run CCleaner tool to wipe off all the OS chores.
  • If your Chrome base version is too old, uninstall Chrome through Revo Uninstaller and install a recent GA Release version of Chrome.
  • Take a System Reboot.
  • Execute your Test.
Sign up to request clarification or add additional context in comments.

7 Comments

JDK is latest as per your suggestions. I downlaoded latest 2.35 chromedriver but still the script is showing it as 2.29. It is in same folder as the script. Hence we can be sure that script is picking the local copy.
Great !!! Follow the steps : 1) Clean the Project Workspace from your IDE & Rebuild All. 2) Run CCleaner tool to wipe off all the OS chores. 3) If your Chrome base version is too old, uninstall Chrome through Revo Uninstaller and install a recent GA Release version of Chrome. 4) Take a System Reboot. 5) Execute you Tests.
don't be too sure about that... it depends on PATH
@CoreyGoldberg Sir, I don't depend on PATH settings for any of the WebDriver variants as such. I decide which version of which WebDriver variant to pick for my Tests and get explicit with the argument executable_path. Do you see a drawback in my approach?
@DebanjanB, your solution of hardcoding the chromedriver.exe path worked for me. Thanks alot
|
3

Go to http://chromedriver.chromium.org/downloads

copy the download link according to your OS

wget -N paste_the_link_you_copied

unzip it using below command

unzip chromedriver_linux64.zip

Give the permission by the below command

chmod +x chromedriver

Then follow the below commands, if it says already exists (probabily old version) then go to that path (/usr/local/bin/chromedriver and /usr/bin/chromedriver) and delete chromedriver and run the commands again

sudo mv -f chromedriver /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver

Hope this helps. Thanks

Comments

2

That error raised beacuse your chrome browser is not compatible with the web driver. If you are using Linux, then simply execute the following command. sudo apt-get update

Comments

1

Recently I am facing the same problem and take me too much time to figure out what's going on, in my situation facing the problem, I did not close the chrome process after using it, so you should check the process exit or not when you exit the app, this is my last worked Python 3 code demo, hope it will help others:

    @staticmethod
    def fetch_music_download_url(music_name: str):
        chrome_driver_service = Service(ChromeDriverManager(chrome_type=ChromeType.GOOGLE).install())
        chrome_options = Options()
        chrome_options.add_argument("--no-sandbox")
        chrome_options.add_argument("--headless")
        chrome_options.add_argument("--disable-gpu")
        chrome_options.add_argument("--remote-debugging-port=9230")
        driver = webdriver.Chrome(service=chrome_driver_service,
                                  options=chrome_options,
                                  executable_path="/usr/local/bin/chromedriver")
        try:
            driver.maximize_window()
            driver.get('http://tool.example.cn/music/?page=audioPage&type=migu&name=' + music_name)
            driver.implicitly_wait(5)
            driver.find_element(By.CSS_SELECTOR, ".aplayer-list-download.iconfont.icon-xiazai").click()
            urls = [a.get_attribute('href') for a in
                    driver.execute_script('return document.querySelectorAll(".modal-body a[href*=\'http\']")')]
            for url in urls:
                if "listenSong.do" in url:
                    logger.info("fetched url:" + url)
                    FetchMusic.do_save_music_download_url(url)
        except Exception as e:
            logger.error("scrapy impl error", e)
        finally:
            driver.stop_client()
            driver.close()
            driver.quit()
            chrome_driver_service.stop()

Comments

0

upgrading didn't solve my issue but this has fixed my issue.

try   {
    Driver.Navigate().GoToUrl(url);   }   
catch (WebDriverException ex)   {
    if (Driver.Url == url)
      return;   }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.