{"id":25063757,"url":"https://github.com/saopayne/gsoup","last_synced_at":"2025-04-14T17:42:38.982Z","repository":{"id":57486605,"uuid":"104508719","full_name":"saopayne/gsoup","owner":"saopayne","description":"A tiny web scraper written in Go with similar features to jsoup","archived":false,"fork":false,"pushed_at":"2018-08-21T13:18:15.000Z","size":10,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-06T20:28:11.886Z","etag":null,"topics":["golang","jsoup","scraper","webscraping","webscrapper"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saopayne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-22T19:00:15.000Z","updated_at":"2023-05-09T21:27:14.000Z","dependencies_parsed_at":"2022-09-10T06:00:13.797Z","dependency_job_id":null,"html_url":"https://github.com/saopayne/gsoup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saopayne%2Fgsoup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saopayne%2Fgsoup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saopayne%2Fgsoup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saopayne%2Fgsoup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saopayne","download_url":"https://codeload.github.com/saopayne/gsoup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237530830,"owners_count":19325217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","jsoup","scraper","webscraping","webscrapper"],"created_at":"2025-02-06T18:45:27.347Z","updated_at":"2025-02-06T18:45:28.046Z","avatar_url":"https://github.com/saopayne.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/saopayne/gsoup.svg?branch=master)](https://travis-ci.org/saopayne/gsoup)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\n# gsoup\n\nA tiny web scraper written in Go with similar features to jsoup\n\n\n## Getting started\n\n```\ngo get github.com/saopayne/gsoup\n```\n\n## Initializing the client\n\n## Usage\n\n``` go\n\nimport (\n    \"https://github.com/saopayne/gsoup\"\n    \"fmt\"\n)\n\n// listing of links given a list of urls\n// using goroutines and channels\nfunc main() {\n\tfoundUrls := make(map[string]bool)\n\tseedUrls := os.Args[1:]\n\n\t// Channels to hold the concurrent requests\n\tchUrls := make(chan string)\n\tchFinished := make(chan bool)\n\n\t// Kick off the crawl process (concurrently) using a goroutine\n\tfor _, url := range seedUrls {\n\t\tgo listLinks(url, chUrls, chFinished)\n\t}\n\n\t// Subscribe to both channels\n\tfor c := 0; c \u003c len(seedUrls); {\n\t\tselect {\n\t\tcase url := \u003c-chUrls:\n\t\t\tfoundUrls[url] = true\n\t\tcase \u003c-chFinished:\n\t\t\tc++\n\t\t}\n\t}\n\n\tfmt.Sprintf(\"\\nUnique urls found are : %d\\n\", len(foundUrls))\n\tfor url := range foundUrls {\n\t\tfmt.Println(\" - \" + url)\n\t}\n\n\tclose(chUrls)\n}\n\n// accessing the DOM elements\nfunc main() {\n\tresp, _ := gsoup.connect(\"\")\n\tdoc := gsoup.HTMLParse(resp)\n\ttitle := doc.Find(\"div\", \"id\", \"id_value\").Text()\n\timage := doc.Find(\"div\", \"id\", \"imageid\").Find(\"img\")\n\tfmt.Println(\"Text linked to the image :\", image.Attrs()[\"title\"])\n}\n\n```\n\n\n## TODO\n- [ ] Write unit tests\n- [ ] Documentation\n\n\n## CONTRIBUTING\n- Fork the repository, make necessary changes and send the PR.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaopayne%2Fgsoup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaopayne%2Fgsoup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaopayne%2Fgsoup/lists"}