V
V
virus72021-03-25 02:20:55
Parsing
virus7, 2021-03-25 02:20:55

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>

2. Do I need to specify all the tags inside which there is a line where the information from paragraph 1 is taken from

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2021-03-25
@virus7

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 question

Ask a Question

731 491 924 answers to any question