Trying to write a web scraper that checks dead links on a webapge

59 views
Skip to first unread message

Dennis Lee

unread,
Feb 13, 2025, 8:30:25 AM2/13/25
to golang-nuts
I am using the net/html package.

I try todo this:
```
doc, err := html.Parse(body)

if err != nil {
  return
}

for n := range node.Descendants()
```
But i cant compile because Descendants isnt implemented on the Node.

I use:
- go version go1.22.3 windows/amd64

If i go trought the Code i see that Descendants is Implemented in a different File to the rest of the Node implementation.

Why does it not import the Iterator?

Jan Mercl

unread,
Feb 13, 2025, 8:37:48 AM2/13/25
to Dennis Lee, golang-nuts
On Thu, Feb 13, 2025 at 2:30 PM Dennis Lee <joll...@gmail.com> wrote:

> I use:
> - go version go1.22.3 windows/amd64

Too old Go version, see https://tip.golang.org/doc/go1.23
Reply all
Reply to author
Forward
0 new messages