如何切换到图中的f3(Selenium + Python)

时间:2017-11-16 13:24:12

标签: python selenium-webdriver

如何切换到f3?{{3​​}}

如何知道当前帧?

以下命令均无效:

driver.switch_to.frame('f3')
driver.switch_to.frame(driver.find_element_by_xpath("//frameset[@name='viewfrm']"))
driver.switch_to.frame(driver.find_element_by_xpath("//frameset[@name='f3']"))

3 个答案:

答案 0 :(得分:2)

尝试等到所需的integrate.dblquad(z1i, min(x2),max(x2),lambda x: min(y2), lambda x: max(y2), epsabs=1.49e-08, epsrel=1.49e-08) 出现:

frame

from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it("f3")) 之后,你可以用相同的方式处理框架" menu"和" toogle"

答案 1 :(得分:0)

请尝试以下代码:

driver.switch_to.frame(driver.find_element_by_name("f3"))

答案 2 :(得分:0)

你的问题没有提到你进入框架后你想要做什么,但这段代码是有效的。它以稍微不同的方式执行代码所做的操作,然后从结果表中打印最后一列。

driver.get("newsmth.net/frames.html") 
driver.switch_to_frame("menu") 
input = driver.find_element_by_css_selector("input[name='board']")
input.clear()
input.send_keys("foodinfo\n")
driver.switch_to_default_content()
driver.switch_to_frame("f3")
rows = driver.find_elements_by_xpath("//table[@class='main wide']//tr/td[5]")
for row in rows
    print row.text