New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/niranjan-n/html-parser

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/niranjan-n/html-parser

  • v0.0.0-20210327140726-a0e0816fcfd9
  • Source
  • Go
  • Socket score

Version published
Created
Source

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

FAQs

Package last updated on 27 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc