【发布时间】:2019-02-12 23:41:06
【问题描述】:
我正在抓取他的网站。创建一个帐户。下面是网址
进入本站后,点击"Dont have an account yet?",在下一页点击"Agree"。
我有安全问题要填写。为此,我编写了以下脚本。
def findxpath_AddKey(xpath, key1, id, key2):
element = browser.find_element_by_xpath(xpath)
element.click()
browser.execute_script("arguments[0].setAttribute('aria-activedescendant',{})".format(key1),element)
span = browser.find_element_by_id(id)
browser.execute_script("arguments[0].innerText = {}".format(key2), span)
browser.execute_script("arguments[0].setAttribute('class',\"ui-selectmenu-button ui-button ui-widget ui-selectmenu-button-closed ui-corner-all\")",element)
findxpath_AddKey('//*[@id="selectSecurityQuestion1-button"]',"'ui-id-3'", 'selectSecurityQuestion1-button_text', "'Where is your favorite vacation spot?'")
对其他安全问题重复上述过程,然后单击"continue"。但是该网站正在抛出错误,说是为了填写安全问题。
【问题讨论】:
标签: javascript python angularjs selenium-webdriver drop-down-menu