HTML data deletion

I am accessing some website and I need to extract some data. To be more specific - from this part:

<input type="hidden" value="1" name="d520783895194bd08750e47c744d553d">

I need to extract the "name" part. I have heard that expressions in the time zone are not the best solution, so I would like to ask what is the best way to access this piece of data that I need.

+3
source share
2 answers

After analyzing the site using NekoHTML or TagSoup (which should take care that the input field tag is not closed), I suggest using the xpath expression:

//input[@type='hidden'][@value=1]/@name

In groovy you apply it in GPath form .

+2
source
+2

Source: https://habr.com/ru/post/1765467/


All Articles