Created
June 9, 2014 14:11
-
-
Save Khrol/346c2dc64400137e0e5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver import Firefox | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.remote.webelement import WebElement | |
class Link(WebElement): | |
def get_href(self): | |
return self.get_attribute('href') | |
driver = Firefox() | |
driver.get('http://ya.ru') | |
element = driver.find_element(By.XPATH, 'id("mail")/a') | |
element.__class__ = Link | |
print element.get_href() | |
driver.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment