【发布时间】:2021-03-28 18:35:05
【问题描述】:
所以我正在尝试编写一个脚本来检查网站上的产品。 https://shop.telfar.net/collections/hats-belts/products/logo-belt-oxblood。我可以去结账处填写所有信息。我现在正在尝试将值输入到信用卡字段中,如下所示。 Here is where I am trying to enter in values。元素 ID 是“数字”,但它在 iframe 中,我尝试了切换到 frame 方法,但没有任何反应。如果有人可以提供帮助,将不胜感激。这是我的代码。谢谢
driver.switch_to.frame(0)
driver.find_element_by_xpath('//*[@id="number"]').click()
This is the html of the element when I inspect it
This Is when I select the element which should be inside the iframe
【问题讨论】:
-
您选择了错误的框架,它是 (1) iframe 超过 1 个。
标签: python selenium automation