久久久久久久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 檢測圖像中矩形的中心和角度)
主站蜘蛛池模板: 国产精品观看 | 九九热在线免费视频 | 久久久久久久国产精品影院 | 亚洲免费成人av | 毛片久久久 | 亚洲成人一区二区三区 | 秋霞国产| 午夜视频在线免费观看 | 国产一区二区三区高清 | 成人国产精品久久 | 欧美在线视频一区二区 | 日韩一区二区免费视频 | 国产欧美精品一区二区三区 | 请别相信他免费喜剧电影在线观看 | 欧美一区二区三区在线观看 | 欧美在线视频二区 | 成人精品在线观看 | 国产内谢| 毛片一级片 | 人人精品| 精品视频一区二区三区在线观看 | 国产精品久久久久久久久久久久 | 国产黄视频在线播放 | 中文字幕日韩欧美一区二区三区 | 女人毛片a毛片久久人人 | 91福利在线观看 | 天天成人综合网 | 日韩精品在线观看免费 | 欧美日韩精品国产 | 不卡的av在线 | 亚洲精品一区二区三区丝袜 | 国产精品一区二区无线 | 99免费在线视频 | 国产精品久久久久久高潮 | 成人做爰www免费看视频网站 | 日韩成人在线免费视频 | 国产真实精品久久二三区 | 久久综合久久久 | 亚洲av毛片成人精品 | 国产精品久久久久久婷婷天堂 | 九九热免费视频在线观看 |