小编moh*_*nia的帖子

使用Python selenium单击iframe元素

我怎么可以点击红色按钮,在这里从主机A(在这个例子中jsfiddle.net)使用硒蟒蛇?(java脚本限制策略错误不要让我这样做).我也不想直接点击红色按钮.谢谢.

el = driver.find_element_by_xpath("/ html/body/div 2/input")
webdriver.ActionChains(driver).move_to_element(el).click(el).perform()

保持红色按钮的iframe:

<iframe src="http://www.myhostb.blogfa.com/" width="500" height="300">
</iframe>
Run Code Online (Sandbox Code Playgroud)

重要提示:jsfiddle.net是Host A的成像

DEMO

iframe selenium cross-domain python-3.x

2
推荐指数
1
解决办法
3462
查看次数

标签 统计

cross-domain ×1

iframe ×1

python-3.x ×1

selenium ×1