我怎样才能点击一个元素,即使另一个元素覆盖它
How can I click an element even if another element is covering it
我想点击网站上的按钮,但出现错误
type="submit">...</button> is not clickable at point (455, 612). Other element would receive the click: <div style="height: 34px; width: 163.859px; z-index: 2147483647; cursor: pointer; top: 595px; left: 374.062px; position: fixed;"></div>
我仍然想点击按钮,不管它是否点击了其他元素。
我该怎么做?
您可以 select 元素并使用 JavaScript 单击它
selected_button = ...
driver.execute_script("arguments[0].click()", selected_button)
我想点击网站上的按钮,但出现错误
type="submit">...</button> is not clickable at point (455, 612). Other element would receive the click: <div style="height: 34px; width: 163.859px; z-index: 2147483647; cursor: pointer; top: 595px; left: 374.062px; position: fixed;"></div>
我仍然想点击按钮,不管它是否点击了其他元素。
我该怎么做?
您可以 select 元素并使用 JavaScript 单击它
selected_button = ...
driver.execute_script("arguments[0].click()", selected_button)