Answer the question
In order to leave comments, you need to log in
How to get the contents of the xpath attribute?
Good night all ! Who is strong in xpath please tell me
1. You need to get the content of data-video-id
There are a lot of blocks with the data-video-id attribute and they have different content and you will need to get a new one every time.
<li class="videoblock" id="v5566" data-video-id="5566"> </li>
Answer the question
In order to leave comments, you need to log in
1)
//li/@data-video-id
Tested here: xpather.com
2) Depends on the situation. If there is only one "li" tag on the page, which has the "data-video-id" attribute, then it's not necessary.
XPath Examples - Cheat Sheet for Parsing Pages
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question