Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98509

Searching inside element for another element with python and selenium

$
0
0

Lets say I have this kind of html

<form method post="some.page">
.
.
<span class="warning"<img class"something_img" src="some.jpg" title="jpg title">
</span>
.
.
<p class="input">
 <input class="input" type="submit" value="Click Here" name="action">
</p>
.
.
</form>

<form method post="some.page">
.
.
<p class="input">
 <input class="input" type="submit" value="Click Here" name="action">
</p>
.
.
</form>

The jest is, the page is made out of lots of forms, but I need to locate only submit buttons in forms where the class "warning" exist and skip the inputs where it doesn't.. there can be a lot! of this forms some of them have the "warning" class and some of them don't and I need to click on the first that does have it... (script will than do it stuff, and come back when done to the main page where it again have to look for the input of form where the warning is...it will be on next form as script will solve the issue with old warning )

I'm not sure how to locate that reliably with selenium and python.


Viewing all articles
Browse latest Browse all 98509

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>