我无法选择此下拉列表的不同选项 字段中的大小
https://docs.google.com/forms/d/e/1FAIpQLSdSpGLXjAV_wiI2qgg3B_KYxd4_7NR-DxHGrTySaIkAWIqmBg/viewform
有人有好办法吗? 我可以用鼠标单击元素
driver.find_element_by_xpath('/html/body/div/div[2]/form/div[2]/div/div[2]/div[14]/div/div/div[2]/div/div[1]/div[1]/div[1]').click()
但我无法选择不同的选项
您需要单击列表以打开它,然后查找并单击包含正确内容的范围。由于有一点绘图延迟,您可能希望它使用webdriverwait来确保元素在交互之前准备就绪
这对我很有用:
如果尚未获得,则需要以下导入:
突出显示字号,单击鼠标右键,然后单击“检查”。现在再做一次,它将引导您找到与此相关的HTML。从HTML的根开始往下看,直到找到所需大小的部分(当您将鼠标悬停在代码上时,它将在网站中突出显示相关部分)。希望这将帮助您充分使代码的功能
相关问题 更多 >
编程相关推荐