我正在尝试循环遍历一个ID列表,并用一个值=ID提交每个选项。 提交后,我从表的最后一行获取所需的结果文本。 但是,当我向列表中添加多个“ID”时,基本功能可以工作,它只返回列表中最后一项的结果
这是我的密码:
#Go To Email Logs
driver.get("https://website.com/manager/email_logs.php")
#variables
SaleIds = ['47832', '47842', '49859', '50898']
dropdown = Select(driver.find_element_by_id('emailspecialid'))
options = dropdown.options
for option in options:
value = option.get_attribute('value')
for id in SaleIds:
if id == value:
option.click()
driver.find_element_by_tag_name('input').submit()
result = driver.find_element_by_xpath('/html/body/table[1]/tbody/tr[last()]/td[4]').text
driver.implicitly_wait(100)
print(result)
目前没有回答
相关问题 更多 >
编程相关推荐