本文整理汇总了Python中selenium.webdriver.firefox.webdriver.WebDriver.current_url方法的典型用法代码示例。如果您正苦于以下问题:Python WebDriver.current_url方法的具体用法?Python WebDriver.current_url怎么用?Python WebDriver.current_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类selenium.webdriver.firefox.webdriver.WebDriver
的用法示例。
在下文中一共展示了WebDriver.current_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from selenium.webdriver.firefox.webdriver import WebDriver [as 别名]
# 或者: from selenium.webdriver.firefox.webdriver.WebDriver import current_url [as 别名]
class Application:
def __init__(self):
self.driver = WebDriver()
self.session = SessionHelper(self)
self.group = GroupHelper(self)
self.contact = ContactHelper(self)
def is_valid(self):
try:
self.driver.current_url()
return True
except:
return False
def open_home_page(self):
driver = self.driver
driver.get("http://localhost/addressbook/")
def destroy(self):
self.driver.quit()
示例2: __init__
# 需要导入模块: from selenium.webdriver.firefox.webdriver import WebDriver [as 别名]
# 或者: from selenium.webdriver.firefox.webdriver.WebDriver import current_url [as 别名]
class Application:
def __init__(self):
self.wd = WebDriver()
self.session = SessionHelper(self)
self.group = GroupHelper(self)
self.contact = ContactHelper(self)
def is_valid(self):
try:
self.wd.current_url()
return True
except:
return False
def open_site(self):
# open site
wd = self.wd
wd.get("http://macbook-pro-denis.local/addressbook/index.php")
def destroy(self):
self.wd.quit()