得到一个元素太长了(Python,Selenium)

时间:2017-11-11 16:57:48

标签: python selenium

试图从网页上获取一个元素,但是Selenium仅在8-10秒后识别它,我希望它更快,最大 - 3秒。可能有什么不对?

browser.set_page_load_timeout(3)

    try:
        browser.get('https://shop.palaceskateboards.com/cart')
    except TimeoutException:
        pass

    try:
        checkout_button = wait.until(lambda browser: browser.find_element_by_name('checkout'))
        checkout_button.click()
    except TimeoutException:
        pass

        try:
            element = wait.until(lambda browser: browser.find_element_by_id('checkout_email'))
            element.send_keys('somemail@gmail.com')
        except TimeoutException:
            pass

0 个答案:

没有答案