splinter
splinter copied to clipboard
WebDriverElement's 'parent' attribute does not work as expected
In the DOM world 'parent' is a good name for parent element. However, splinter uses that name for browser. Could you use the name 'browser' instead?
In [3]: browser = splinter.browser.FirefoxWebDriver()
In [4]: browser.visit('http://google.com')
In [5]: logo = browser.find_by_id('hplogo')
In [6]: logo.parent
Out[6]: <splinter.driver.webdriver.firefox.WebDriver at 0x1c0a390>
I also find this a bit strange but it appears that the selenium bindings have the same peculiarity. The API reference describes WebElement.parent as:
Internal reference to the WebDriver instance this element was found from.
@andrewsmedina Seems like we're following WebDriver's lead here. Changing it would probably cause more confusion than anything else.