Skip to content

Pipello/expatcz-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic usage

The original aim of this package is to help scrapping expat.cz articles as such:

func main() {
	link, err := scraper.FindLinkWith("weekend", scraper.BaseURL)
	if err != nil {
		log.Fatal(err)
	}
	ct, err := scraper.GetArticleContent(link)
	if err != nil {
		log.Fatal(err)
	}
	file, err := os.Create("events.json")
	if err != nil {
		log.Fatal(err)
	}
	err = json.NewEncoder(file).Encode(ct)
	if err != nil {
		log.Fatal(err)
	}
}

giving result like this

{
    "Content": "On May 18, peruse military equipment and weapons at Atrium Flora, which will be transformed into a military base...",
    "Title": "MILITARY MARVELS "
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages