当前位置: 首页>>代码示例>>Python>>正文


Python splinter.Browser方法代码示例

本文整理汇总了Python中splinter.Browser方法的典型用法代码示例。如果您正苦于以下问题:Python splinter.Browser方法的具体用法?Python splinter.Browser怎么用?Python splinter.Browser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在splinter的用法示例。


在下文中一共展示了splinter.Browser方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_login

# 需要导入模块: import splinter [as 别名]
# 或者: from splinter import Browser [as 别名]
def test_login(self):
        """Test logging in `testrp` using OIDC"""
        browser = Browser(self.webdriver, headless=True)

        # Check that user is not logged in
        browser.visit('http://testrp:8081')
        self.assertTrue(browser.is_text_not_present('Current user:'))

        # Perform login
        self.perform_login(browser)

        # Accept scope
        browser.find_by_css('input[name="allow"]').click()

        # Check that user is now logged in
        self.assertTrue(browser.is_text_present('Current user:')) 
开发者ID:mozilla,项目名称:mozilla-django-oidc,代码行数:18,代码来源:integration_tests.py

示例2: test_logout

# 需要导入模块: import splinter [as 别名]
# 或者: from splinter import Browser [as 别名]
def test_logout(self):
        """Test logout functionality of OIDC lib"""
        browser = Browser(self.webdriver, headless=True)

        # Check that user is not logged in
        browser.visit('http://testrp:8081')
        self.assertTrue(browser.is_text_not_present('Current user:'))

        self.perform_login(browser)

        # Accept scope
        browser.find_by_css('input[name="allow"]').click()

        # Check that user is now logged in
        self.assertTrue(browser.is_text_present('Current user:'))

        self.perform_logout(browser)

        # Check that user is now logged out
        self.assertTrue(browser.is_text_not_present('Current user:')) 
开发者ID:mozilla,项目名称:mozilla-django-oidc,代码行数:22,代码来源:integration_tests.py

示例3: __init__

# 需要导入模块: import splinter [as 别名]
# 或者: from splinter import Browser [as 别名]
def __init__(self):
        """Initiate object with default encoding and other required data."""
        # Expect some weird characters from fuzz lists, make encoding UTF-8
        reload(sys)
        sys.setdefaultencoding('utf8')

        # All potential XSS findings
        self.xss_links = []

        # Fuzzy string matching partials list
        self.xss_partials = []

        # Keep index of screens for log files
        self.screen_index = ""

        # Get user args and store
        self.user_args = self.parse_args()

        # PhantomJS browser
        self.browser = Browser("phantomjs") 
开发者ID:shogunlab,项目名称:shuriken,代码行数:22,代码来源:shuriken_xss.py

示例4: __init__

# 需要导入模块: import splinter [as 别名]
# 或者: from splinter import Browser [as 别名]
def __init__(self):
        self.captcha_element = None
        self.browser = splinter.Browser()
        self.neural_net = nn.NeuralNetwork(weights_file=config['weights_path'])
        self.num_correct = 0
        self.num_guesses = 0
        self.old_captcha_urls = [] 
开发者ID:nocturnaltortoise,项目名称:recaptcha-cracker,代码行数:9,代码来源:captcha_input.py

示例5: __init__

# 需要导入模块: import splinter [as 别名]
# 或者: from splinter import Browser [as 别名]
def __init__(self):

        self.db = database.match_database()
        self.db.remove_old_matches()

        self.br = splinter.Browser('chrome') 
开发者ID:HaraldNordgren,项目名称:betting-crawler,代码行数:8,代码来源:betting_site.py

示例6: browser

# 需要导入模块: import splinter [as 别名]
# 或者: from splinter import Browser [as 别名]
def browser():
    from splinter import Browser
    return Browser('django') 
开发者ID:fossevents,项目名称:fossevents.in,代码行数:5,代码来源:fixtures.py

示例7: setUp

# 需要导入模块: import splinter [as 别名]
# 或者: from splinter import Browser [as 别名]
def setUp(self):
        """Create test account in `testprovider` instance"""
        with Browser(self.webdriver, headless=True) as browser:
            browser.visit('http://testprovider:8080/account/signup')
            browser.find_by_css('#id_username').fill(self.account['username'])
            browser.find_by_css('#id_password').fill(self.account['password'])
            browser.find_by_css('#id_password_confirm').fill(self.account['password'])
            browser.find_by_css('#id_email').fill(self.account['email'])
            browser.find_by_css('.btn-primary').click() 
开发者ID:mozilla,项目名称:mozilla-django-oidc,代码行数:11,代码来源:integration_tests.py

示例8: tearDown

# 需要导入模块: import splinter [as 别名]
# 或者: from splinter import Browser [as 别名]
def tearDown(self):
        """Remove test account from `testprovider` instance"""
        with Browser(self.webdriver, headless=True) as browser:
            self.perform_login(browser)
            browser.visit('http://testprovider:8080/account/delete')
            browser.find_by_css('.btn-danger').click() 
开发者ID:mozilla,项目名称:mozilla-django-oidc,代码行数:8,代码来源:integration_tests.py

示例9: __init__

# 需要导入模块: import splinter [as 别名]
# 或者: from splinter import Browser [as 别名]
def __init__(self, un, pw):
                self.username = un;
                self.password = pw;
                self.currentPage = 0;
                self.messageID = 0;
                self.browser = Browser("phantomjs");
                pass; 
开发者ID:maruthven,项目名称:megbot,代码行数:9,代码来源:megbot.py

示例10: get_claim_code_from_server

# 需要导入模块: import splinter [as 别名]
# 或者: from splinter import Browser [as 别名]
def get_claim_code_from_server():
  browser = Browser('phantomjs', service_args=['--ignore-ssl-errors=true'])
  browser.visit(ROOT_ADDRESS + "/merchant-login")
  browser.fill_form({"email": USER_NAME, "password": PASSWORD})
  browser.find_by_id("loginButton")[0].click()
  time.sleep(5)
  browser.visit(ROOT_ADDRESS + "/api-tokens")
  browser.find_by_css(".token-access-new-button").find_by_css(".btn").find_by_css(".icon-plus")[0].click()
  browser.find_by_id("token-new-form").find_by_css(".btn")[0].click()
  return browser.find_by_css(".token-claimcode")[0].html 
开发者ID:bitpay,项目名称:bitpay-python,代码行数:12,代码来源:pair_steps.py

示例11: crea_sessione

# 需要导入模块: import splinter [as 别名]
# 或者: from splinter import Browser [as 别名]
def crea_sessione(wait_time=5):
    from splinter import Browser
    browser = Browser(driver_name=SELENIUM_DRIVER, url=SELENIUM_URL,
                      browser=SELENIUM_BROWSER,
                      wait_time=wait_time)
    return browser 
开发者ID:CroceRossaItaliana,项目名称:jorvik,代码行数:8,代码来源:utils_tests.py


注:本文中的splinter.Browser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。