https://github.com/badoux/goscraper
Golang pkg to quickly return a preview of a webpage (title/description/images)
https://github.com/badoux/goscraper
crawler description engine go golang icon image page preview scrape scraper scrapper title url webpage website
Last synced: 1 day ago
JSON representation
Golang pkg to quickly return a preview of a webpage (title/description/images)
- Host: GitHub
- URL: https://github.com/badoux/goscraper
- Owner: badoux
- License: mit
- Created: 2017-01-26T10:46:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-03-12T14:42:30.000Z (over 3 years ago)
- Last Synced: 2024-06-18T14:11:34.378Z (about 2 years ago)
- Topics: crawler, description, engine, go, golang, icon, image, page, preview, scrape, scraper, scrapper, title, url, webpage, website
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 104
- Watchers: 1
- Forks: 39
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# goscraper
[Golang](http://golang.org/) package to quickly return a preview of a webpage, you can get easily its title, description & images
## Usage
func main() {
s, err := goscraper.Scrape("https://www.w3.org/", 5)
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("Icon : %s\n", s.Preview.Icon)
fmt.Printf("Name : %s\n", s.Preview.Name)
fmt.Printf("Title : %s\n", s.Preview.Title)
fmt.Printf("Description : %s\n", s.Preview.Description)
fmt.Printf("Image: %s\n", s.Preview.Images[0])
fmt.Printf("Url : %s\n", s.Preview.Link)
}
output:
**Icon :** https://www.w3.org/favicon.ico
**Name :** www.w3.org
**Title :** World Wide Web Consortium (W3C)
**Description :** The World Wide Web Consortium (W3C) is an international community where Member organizations, a full-time staff, and the public work together to develop Web standards.
**Image:** https://www.w3.org/2008/site/images/logo-w3c-mobile-lg
**Url :** https://www.w3.org/
## License
Goscraper is licensed under the [MIT License](./LICENSE).