当我尝试在 Python 的 selenium 中使用 Webdriver 切换到网页上的框架时,它显示错误。请在下面找到我的代码:
driver.switchTo().frame("frame");
AttributeError: 'WebDriver' object has no attribute 'switchTo'
最佳答案
那是因为您正在使用 Java
方法。在 Python
中你应该使用
driver.switch_to.frame("frame_name")
关于python - 函数 driver.switchTo.frame() 在 Selenium 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45831217/