I get output from an ajax request as below:
<div style='font-size:12px; font-weight:bold; line-height:17px;'>These results were cached from March 10, 2021, 1:11 pm PST to conserve server resources. <br/>If you are diagnosing a certificate installation problem,
you can get uncached results by <a href="" id="captchaLink">clicking here</a>.</div><table class='checker_messages'><tr><td class='passed'> </td><td><h3>www.Google.com resolves to 172.217.11.36</h3><</h3></td><tr><tr><td class='passed'> </td><td><h3>The certificate should be trusted by all major web browsers (all the correct intermediate certificates are installed).</h3></td><tr><tr><td class='passed'> </td><td><h3><table class=""><tr><td>The certificate will expire in <span id="cert_expiration_days">62</span> days. </td>
<td style="padding-left:10px;"><a href="" class="btn btn-blue" id="reminderButton">Remind me</a></td></tr></table><input type="hidden" id="cert_valid_to" value="1620822887" /></h3></td><tr><tr><td class='passed'> </td><td><h3>The hostname (www.Google.com) is correctly listed in the certificate.</h3></td><tr></table><table class='checker_certs'><tr><td class='cert'><img src='/assets/templates/sslshopper/images/sslchecker/certificate_good_server.png' height='128' width='128' /></td><td><b>Common name:</b> www.google.com<br/><b>SANs:</b> www.google.com<br/><b>Organization:</b> Google LLC<br/><b>Location:</b> Mountain View, California, US<br/><b>Valid</b> from February 17, 2021 to May 12, 2021<br/><b>Serial Number:</b> 46638b76e6854ad205000000008779ef<br/><b>Signature Algorithm:</b> sha256WithRSAEncryption<br/><b>Issuer:</b> GTS CA 1O1<td></tr><tr><td class='chain'><img src='/assets/templates/sslshopper/images/sslchecker/arrow_down.png' height='48' width='48' /></td><td> </td></tr><tr><td class='cert'><img src='/assets/templates/sslshopper/images/sslchecker/certificate_good_chain.png' height='128' width='128' /></td><td><b>Common name:</b> GTS CA 1O1<br/><b>Organization:</b> Google Trust Services<br/><b>Location:</b> US<br/><b>Valid</b> from June 14, 2017 to December 14, 2021<br/><b>Serial Number:</b> 01e3b49aa18d8aa981256950b8<br/><b>Signature Algorithm:</b> sha256WithRSAEncryption<br/><b>Issuer:</b> GlobalSign<td></tr></table><input type='hidden' id='reminderCertID' value='58366913' /><input type='hidden' id='expirationDate' value='1620822887' /><input type='hidden' id='clean_hostname' value='www.Google.com' />
When I try to parse td
using goquery using below snippet:
doc, err := goquery.NewDocumentFromReader(strings.NewReader(pageContent))
if err != nil {
panic(err)
}
doc.Find("td").Each(func(i int, s *goquery.Selection) {
fmt.Printf("%s\n", s.Text())
})
Output:
www.Google.com resolves to 172.217.11.36
Server Type: gws
The certificate should be trusted by all major web browsers (all the correct intermediate certificates are installed).
The certificate will expire in 62 days.
Remind me
The certificate will expire in 62 days.
Remind me
The hostname (www.Google.com) is correctly listed in the certificate.
Common name: www.google.comSANs: www.google.comOrganization: Google LLCLocation: Mountain View, California, USValid from February 17, 2021 to May 12, 2021Serial Number: 46638b76e6854ad205000000008779efSignature Algorithm: sha256WithRSAEncryptionIssuer: GTS CA 1O1
Common name: GTS CA 1O1Organization: Google Trust ServicesLocation: USValid from June 14, 2017 to December 14, 2021Serial Number: 01e3b49aa18d8aa981256950b8Signature Algorithm: sha256WithRSAEncryptionIssuer: GlobalSign
When I try using b
tag instead of td
i get output as below:
Common name:
SANs:
Organization:
Location:
Valid
Serial Number:
Signature Algorithm:
Issuer:
Common name:
Organization:
Location:
Valid
Serial Number:
Signature Algorithm:
Issuer:
The output I am trying to achieve is to get only Organization: Google LLC
.
I recently started using StackOverflow and new to golang so I am not familiar with the environment if I make mistake then let me know.