html-parser

module
v0.0.0-...-a0e0816 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2021 License: MIT

README

HTML-Parser

HTML link Parser. Go exercise

The goal of this project is to parse an HTML file and extract all of the links (<a href="">...</a> tags). For each extracted link it should return a data structure that includes both the href, as well as the text inside the link. Any HTML inside of the link can be stripped out, along with any extra whitespace including newlines, back-to-back spaces, etc.

Input:

<a href="/dog">
  <span>Something in a span</span>
  Text not in a span
  <b>Bold text!</b>
</a>

Output:

Link{
  Href: "/dog",
  Text: "Something in a span Text not in a span Bold text!",
}

To run this project.

git clone https://github.com/niranjan-n/HTML-Parser.git

go run example1/main.go

go run example2/main.go

go run example3/main.go

go run example4/main.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL