Issue
i ha ve this html
<yt-formatted-string id="text" class="style-scope ytd-button-renderer style-primary size-default">
All
</yt-formatted-string><paper-ripple class="style-scope tp-yt-paper-button">
this xpath works with selenium python
//yt-formatted-string[text()='All']
but how can i include the part id="text" of the html to my xpath expression to be valid to find with selelnium python
thanks a lot
Solution
You can use
//yt-formatted-string[@id='text' and text()='All']
or the more general approach
//yt-formatted-string[@id='text' and contains(text(),'All')]
Answered By - zx485
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.