url=http://ptvtelecom.com/ 如果您按照url并单击屏幕中间显示的“combrobar”按钮,它会将您带到需要填写的表单。我想知道如何用硒来填写表格。你知道吗
所以我已经试着用id和name来查找元素,但是没有用。例如,任何关于如何找到第一个文本框的元素的帮助都将被大大简化。你知道吗
option = webdriver.ChromeOptions()
option.add_argument(" — incognito")
browser =
webdriver.Chrome(executable_path='/Users/grsanchez/downloads/chromedriverM',
options=option)
browser.get('http://ptvtelecom.com/')
browser.find_element_by_xpath('//*
[@id="cobertura"]/div/div[2]/div/div/p/a').click()
这就是问题所在
name = browser.find_element_by_id('nombre')
name.send_keys('user1')
你需要切换到iframe驱动程序.switchTo().框架(“a077aa5e”)
然后在iframe中使用定位器
阅读代码中的注释,了解代码不起作用的原因。
基本上,您正在尝试选择iframe中存在的东西。你知道吗
PS要返回主框架,可以执行以下操作:
相关问题 更多 >
编程相关推荐