在Python中使用Selenium在iframe中单击按钮

问题描述

我正在使用带有Selenium和Python的Chrome扩展程序INSSIST自动执行Instagram Story。

我已使用Xpath选择了iframe,然后切换到该框架。我尝试了“单击并悬停”以单击按钮,但没有任何效果。为什么我无法单击按钮类?而我该怎么办呢?

#Iframe Switch
q=driver.find_element_by_xpath('//*[@id="app"]/div[1]/div[2]/div[2]/div[1]/div[2]/div/div/div[3]/iframe')
driver.switch_to.frame(q)
#Clicking  
story=driver.find_element_by_xpath('//*[@id="react-root"]/section/nav[1]/div/div/header/div/div[1]/button')
story.click() #not working

#Hovering
hover = ActionChains(driver).move_to_element(story)
hover.perform() #not working 

Full Code files

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...