我有一个html元素:
<button class="expedition_button awesome-button " onclick="attack(null, '6', 2, 0, '')"><div></div><div></div></button>
因为某种原因我不能用我的代码点击它。。。 只是给了我一个关于不按类查找元素的错误。。。你知道吗
有没有一种方法可以发送“onclick”按钮的功能以及该按钮所包含的信息?i、 e发送此按钮的功能信息-“攻击(null,'6',2,0,')”
或者用这些信息找到按钮
我试过了,但好像找不到。。给我这个:
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: /html/body/div[2]/div/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/button
当我检查xpath时,每次打开页面时都会看到它的变化。。你知道吗
我猜你有一个div元素,它的惟一id是'expedition\u info1'。您可以使用xpath Axes来单击与这个
div
元素相关的button
。 尝试:好的,我尽我所能地把这些放在一起,因为我不使用Python编写代码,所以我的语法在某些地方可能不正确,但我努力做到正确,无论哪种情况,逻辑都是存在的,注释应该解释我在做什么:
首先让我们获取容器div:
相关问题 更多 >
编程相关推荐