久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

python selenium點擊按鈕

python selenium click on button(python selenium點擊按鈕)
本文介紹了python selenium點擊按鈕的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我對 python selenium 很陌生,我正在嘗試單擊具有以下 html 結構的按鈕:

I am quite new to python selenium and I am trying to click on a button which has the following html structure:

<div class="b_div">

    <div class="button c_button s_button" onclick="submitForm('mTF')">
        <input class="very_small" type="button"></input>
        <div class="s_image"></div>
        <span>
           Search
        </span>
    </div>

    <div class="button c_button s_button" onclick="submitForm('rMTF')" style="margin-bottom: 30px;">
        <input class="v_small" type="button"></input>
        <span>
              Reset
        </span>
   </div>

</div>

我希望能夠同時單擊上面的 SearchReset 按鈕(顯然是單獨的).

I would like to be able to click both the Search and Reset buttons above (obviously individually).

我已經嘗試了幾件事,例如:

I have tried a couple of things, for example:

driver.find_element_by_css_selector('.button .c_button .s_button').click()

或者,

driver.find_element_by_name('s_image').click()

或者,

driver.find_element_by_class_name('s_image').click()

但是,我似乎總是以 NoSuchElementException 結束,例如:

but, I seem to always end up with NoSuchElementException, for example:

selenium.common.exceptions.NoSuchElementException: Message: u'Unable to locate element: {"method":"name","selector":"s_image"}' ;

我想知道是否可以以某種方式使用 HTML 的 onclick 屬性來使 selenium 點擊?

I am wondering if I can somehow use the onclick attributes of the HTML to make selenium click?

任何可以為我指明正確方向的想法都會很棒.謝謝.

Any thoughts which can point me in the right direction would be great. Thanks.

推薦答案

對于python,使用

For python, use the

from selenium.webdriver import ActionChains

ActionChains(browser).click(element).perform()

這篇關于python selenium點擊按鈕的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to draw a rectangle around a region of interest in python(如何在python中的感興趣區域周圍繪制一個矩形)
How can I detect and track people using OpenCV?(如何使用 OpenCV 檢測和跟蹤人員?)
How to apply threshold within multiple rectangular bounding boxes in an image?(如何在圖像的多個矩形邊界框中應用閾值?)
How can I download a specific part of Coco Dataset?(如何下載 Coco Dataset 的特定部分?)
Detect image orientation angle based on text direction(根據文本方向檢測圖像方向角度)
Detect centre and angle of rectangles in an image using Opencv(使用 Opencv 檢測圖像中矩形的中心和角度)
主站蜘蛛池模板: 日本www在线观看 | 黄色特级毛片 | 综合久久综合 | 毛片在线免费 | 中文字幕日本在线 | 中文一区二区 | 欧美日韩视频在线 | 激情久久久久 | 国产一区二区日韩 | 欧美日韩精品一区二区 | 亚洲成人免费观看 | www.爱爱 | 99视频 | 成人一级毛片 | 在线婷婷 | 中文字幕在线观看不卡 | 日韩精品久久久久久久 | 91精品国自产在线观看 | 国产精品一区二区三区不卡 | 日日不卡av | 欧美视频久久 | 一区二区在线免费观看 | 国产suv一区二区 | 日韩一区二区三免费高清在线观看 | 91激情网 | 在线观看黄色av | 国产视频在线观看视频 | 中文字幕永久在线 | 日韩国产中文字幕 | 日韩一区在线播放 | 一区二区免费在线观看 | 麻豆精品一区 | 日韩一区二区在线观看视频 | 天堂一区二区三区 | 午夜免费观看视频 | 青青青操| 91精品国自产在线观看 | 久久久午夜精品 | 国产精品一区二区视频 | 日韩欧美一级 | 免费毛片观看 |