日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Element is not clickable at point,Other element would receive the click: xxx 遇到某个对象Click()不能正常使用?

發布時間:2023/12/18 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Element is not clickable at point,Other element would receive the click: xxx 遇到某个对象Click()不能正常使用? 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

環境:python3.6 + selenium 3.11 +? chromedriver.exe

在處理一個button對象的時候,需要激發一個click事件,但是這個button或者link外面包含了特別多的div和復雜的樣式,如下圖:

原代碼如下:

view_detail_tag = trTag.find_element_by_css_selector("[class='next-table-cell']") btn_div = view_detail_tag.find_element_by_css_selector("[class='next-btn next-btn-text next-btn-primary next-btn-medium']") btn_div.click()

btn_div 的對象可以被正常獲取到,但是在執行 btn_div.click()函數的時候遇到如下錯誤。

Error 信息如下:

WebDriverException: Message: Element is not clickable at point (918, 13). Other element would receive the click: <div class="xxx"></div>

?意思是說,點擊這個button的時候,這個單擊事件被上層的div給接收了……說明div覆蓋在這個button上面。

這時候我們就不能直接發送click事件了。需要做如下處理:

view_detail_tag = trTag.find_element_by_css_selector("[class='next-table-cell last']") btn_div = view_detail_tag.find_element_by_css_selector("[class='next-btn next-btn-text next-btn-primary next-btn-medium']")#方法1 btn_div.send_keys("\n")#方法2 btn_div.send_keys(Keys.SPACE) #方法3 driver.execute_script("arguments[0].click();", btn_div)

通過這種方式,可以正常點擊選擇的button了.

?

總結

以上是生活随笔為你收集整理的Element is not clickable at point,Other element would receive the click: xxx 遇到某个对象Click()不能正常使用?的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。