GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Leonelcode/GoCrawler: Tool for web scraping using the go library Goquery by PuerkitoBio

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
example/lib/src
example/lib/src
 
 
README.md
README.md
 
 
main.go
main.go
 
 

Repository files navigation

GoCrawler

GoCrawler is a golang tool for scraping data of websites using the golang library Goquery.

Features

  • Function to get all links related to a DOM element.
  • Function to obtain the metadata of a web.
  • Function to extract some element of the DOM.

Using Goquery

package main

import (
    // import standard libraries
    "fmt"
    "log"

    // import third party libraries
    "github.com/PuerkitoBio/goquery"
)

func postScrape() {
    doc, err := goquery.NewDocument("https://es.wikipedia.org/wiki/Vanuatu")
    if err != nil {
        log.Fatal(err)
    }

    // use CSS selector found with the browser inspector
    // for each, use index and item
    doc.Find(".mw-body-content").Each(func(index int, item *goquery.Selection) {
        title := item.Text()
        linkTag := item.Find("p")
        link, _ := linkTag.Attr("href")
        fmt.Printf("Post #%d: %s - %s\n", index, title, link)
    })
}

func main() {
    postScrape()
}

Credits

  • Leonel Vega

License

GNU

About

Tool for web scraping using the go library Goquery by PuerkitoBio

Topics

golang-toolsscraping-websitesscrapperspider

Resources

Readme
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.