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

python selenium點(diǎn)擊按鈕

python selenium click on button(python selenium點(diǎn)擊按鈕)
本文介紹了python selenium點(diǎn)擊按鈕的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我對(duì) python selenium 很陌生,我正在嘗試單擊具有以下 html 結(jié)構(gòu)的按鈕:

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>

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

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

我已經(jīng)嘗試了幾件事,例如:

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 結(jié)束,例如:

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 屬性來(lái)使 selenium 點(diǎn)擊?

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

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

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

推薦答案

對(duì)于python,使用

For python, use the

from selenium.webdriver import ActionChains

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

這篇關(guān)于python selenium點(diǎn)擊按鈕的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

How to draw a rectangle around a region of interest in python(如何在python中的感興趣區(qū)域周圍繪制一個(gè)矩形)
How can I detect and track people using OpenCV?(如何使用 OpenCV 檢測(cè)和跟蹤人員?)
How to apply threshold within multiple rectangular bounding boxes in an image?(如何在圖像的多個(gè)矩形邊界框中應(yīng)用閾值?)
How can I download a specific part of Coco Dataset?(如何下載 Coco Dataset 的特定部分?)
Detect image orientation angle based on text direction(根據(jù)文本方向檢測(cè)圖像方向角度)
Detect centre and angle of rectangles in an image using Opencv(使用 Opencv 檢測(cè)圖像中矩形的中心和角度)
主站蜘蛛池模板: 青青伊人久久 | 国产高清视频一区二区 | 黄色av网站在线观看 | 亚洲精品久久久久久久久久吃药 | 在线免费看91 | 中文字幕av免费 | 日韩精品在线免费观看视频 | 丝袜 亚洲 欧美 日韩 综合 | 九九热这里只有精品在线观看 | 亚洲第一区国产精品 | 国内精品久久久久 | 欧美人成在线视频 | 欧美日韩亚洲二区 | 亚洲免费在线观看av | 久草在线 | 国产精品一区二区久久 | 国产一区二区三区在线 | 欧美综合一区二区 | 亚洲h色| 91亚洲精 | 国产黄色一级片 | 青草久久免费视频 | 粉嫩国产精品一区二区在线观看 | 成人1区2区 | 2022国产精品| 久久国内精品 | 欧美日韩大陆 | 雨宫琴音一区二区在线 | 欧美精品一区三区 | 欧美中文字幕一区二区三区亚洲 | 中文字幕免费中文 | 一区二区三区日 | 99热.com| 国产精品欧美一区二区三区不卡 | 欧美激情一区二区三区 | 天天色天天射天天干 | 成人在线视频免费看 | 成人在线看片 | 国产精品久久久久久吹潮日韩动画 | 老子午夜影院 | 国产成人精品一区二区三区四区 |