Skip to content

taran1sdev/htmlLinkParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

htmlLinkParser

Build:

git clone https://github.com/taran1sdev/htmlLinkParser.git
cd htmlLinkParser
go install golang.org/x/net/html
go mod init link
go build main.go

Usage:

htmlLinkParser -htmlFile=yourfile.html

Example:

htmlLinkParser -htmlFile=./test/ex1.html
href: /other-page | Text: A link to another page

The application takes a html file as input and uses the x/net/html package to parse the html tree.

It performs a recursive depth-first-search to find all the ElementNodes that are anchor <a> tags.

It creates a struct to store the value of the 'href' Attribute and the Data stored within the FirstChild of each ElementNode.

It prints these values to the command-line.

About

Command-Line HTML Link Parser

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published