There is such a question, you need to parse the HTML page on Groovy. Google third-party libraries, but the problem is that, alas, I only need to use the standard Groovy library, and here I was no longer able to google. Perhaps someone faced this. If it is not difficult, tell me how to implement it (what to use).

Thank you in advance.

  • Look towards the XmlSlurper. stackoverflow.com/questions/28110181/… - ezhov_da
  • In many ways it can be implemented. What exactly does "parse HTML" mean in your case? - Sergey Gornostaev
  • @SergeyGornostaev is good at extracting and analyzing + transfer to the next stage certain fields of the page. But you just need to extract the HTML code of the page so that I can access the content from the code itself. - Celtic Boozer

1 answer 1

In order to pick up the html I used the URL class and the getText () method.

def a = new URL("https://habr.com/") String p = a.getText() 

And after that I used regular expressions to find the data I needed. The solution is not the best, but if your possibilities are limited only by the standard library, no better was found.