html code:

 <div class="email_with_fixed_size_and_ellipsis us_font100 us_label" data-pinfo="true" data-qa="data_email"> email@gmail.com </div> 

Parsing regexp is completely different, although I don’t even know how to properly parse html data div, class , etc. I looked in Google, very few crawlers, did not really understand anything, tried to do the same, nothing happened ...

How can I get email@gmail.com ? And how can I get data from the fields? (text html more than 30 thousand characters)

  • one
    look, you may find that interesting godoc.org/golang.org/x/net/html - Sublihim
  • @Sublihim have something easier and more practical? - Jack Anderson
  • There is only regular, if you need to get soap. the rest will work slower. - And

1 answer 1

Look at the GoQuery package, it allows you to use including css selectors.

In your case there will be something like this:

 doc.Find(".email_with_fixed_size_and_ellipsis").Each(func(i int, s *goquery.Selection) { email := s.Text() ... fmt.Printf("New email: %s\n", email) })