我试图输入一个地址,然后他们向我推荐了一些地址,我不知道如何选择他们给我的第一个选项
如果您想尝试,请在该链接的第二步:https://www.sneakql.com/en-GB/launch/culturekings/womens-air-jordan-1-high-og-court-purple-au/register
adresse = chrome.find_element_by_id('address-autocomplete')
adresse.send_keys(row['Adresse']) #Adress from a file
time.sleep(5)
country = chrome.find_element_by_xpath('//li[@id="suggestion_0"]').click();
检查元件:
您应该单击此字段,然后等待第一个选项变为可单击
我已经编写了一些代码来测试我的解决方案是否有效,并且在所有情况下对我都有效:
请注意,并非所有显式等待都是必需的,我使用了css选择器,因为我不确定所有元素ID是否正确
我的输出:
尝试用以下命令单击第一个选项:
UPD
试图单击的图元不在视图中。您必须执行以下操作:
相关问题 更多 >
编程相关推荐