python - Getting "Message: h is null" -
i've encountered i've never seen before while using selenium
.
the code (quite simple , straightforward):
from selenium import webdriver driver = webdriver.firefox() driver.get("http://www.drugs.com/drug-class/laxatives.html?condition_id=&generic=0&sort=rating&order=desc") print driver.find_element_by_tag_name("title").text
here stack trace of error i'm getting:
traceback (most recent call last): file "/users/a/p/so/selenium_scripts/test.py", line 6, in <module> print driver.find_element_by_tag_name("title").text file "/users/a/.virtualenvs/so/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 328, in find_element_by_tag_name return self.find_element(by=by.tag_name, value=name) file "/users/a/.virtualenvs/so/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 664, in find_element {'using': by, 'value': value})['value'] file "/users/a/.virtualenvs/so/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 175, in execute self.error_handler.check_response(response) file "/users/a/.virtualenvs/so/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 166, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.webdriverexception: message: h null
using firefox 37.0 , selenium 2.45.0.
observations:
- if switch
webdriver.chrome()
- don't see errors - if use different url, e.g.
https://google.com
- don't see errors i've tried explicitly wait search results visible before making further actions, still same error, code i've used:
from selenium import webdriver selenium.webdriver.common.by import selenium.webdriver.support.ui import webdriverwait selenium.webdriver.support import expected_conditions ec driver = webdriver.firefox() driver.get("http://www.drugs.com/drug-class/laxatives.html?condition_id=&generic=0&sort=rating&order=desc") # wait table list load webdriverwait(driver, 10).until(ec.presence_of_element_located((by.css_selector, "table.data-list")))
- it not googleable means web-site specific, but, noted before, no errors in chrome
where error coming , can prevent/fix it? mean cannot browser/locate elements on particular web page using selenium+firefox?
looks selenium 2.45.0 not support ff 37
.
the change log shows selenium 2.44 supported ff33. selenium 2.45 released around feb 26th 2015, while ff37 released on march 31st 2015.
Comments
Post a Comment