I want to get the a
element with xpath by the class dropdown-item
and the inner text lalalaaaaaaaaa
:
<a _ngcontent-pde-c12="" class="dropdown-item" style="padding:10px">
<i _ngcontent-pde-c12="" aria-hidden="true" class="fa fa-file-excel" style="color:#207144;font-
size:18px;"></i>
lalalaaaaaaaaa
</a>
but there is a problem with the part of the inner text - probably because of the
.
Can anyone help me please?
You can use contains in your XPath
xpath = "//a[@class='dropdown-item' and contains(@text, 'lalalaaaaaaaaa')]"
Try with Xpath
with help of partial text
and class
//a[@class='dropdown-item' and contains(., 'lalalaaaaaaaaa')]
only with partial text
//a[contains(., 'lalalaaaaaaaaa')]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.