I
I
Ivan2021-03-29 14:11:37
go
Ivan, 2021-03-29 14:11:37

How to remove an unnecessary class from the result in the GO parser (more details inside)?

Good afternoon. It is necessary to pull out everything from the div with the class vacancy-post, except for the h2 with the class vacancy-page-titleAs I understand it, this can be done through RemoveClass(""), but somehow it does not work.

longDescription = s.Find(".vacancy-post").RemoveClass("vacancy-page-title").Text()

This text is included in the result. What am I doing wrong and how can I remove it?

6061b582c1a5e496336529.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pavlyuk, 2021-03-29
@Djonson86

No, RemoveClass removes a class from elements, it does not remove elements with that class.
You need a Not() function

longDescription = s.Find(".vacancy-post").Not(".vacancy-page-title").Text()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question