{"id":29053399,"url":"https://github.com/hasdata/find-urls-from-any-domain","last_synced_at":"2026-05-06T17:31:58.911Z","repository":{"id":294235278,"uuid":"986339117","full_name":"HasData/find-urls-from-any-domain","owner":"HasData","description":"This repository provides practical examples of website link scraping using Python and Node.js.","archived":false,"fork":false,"pushed_at":"2025-05-19T13:34:22.000Z","size":336,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-27T12:35:17.610Z","etag":null,"topics":["ai-extraction","crawler","hasdata-api","nodejs","python","sitemap-parser","url-extraction","web-crawling","web-scraping"],"latest_commit_sha":null,"homepage":"https://hasdata.com/blog/find-all-urls-on-a-domain","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HasData.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-19T13:12:00.000Z","updated_at":"2025-05-19T13:39:25.000Z","dependencies_parsed_at":"2025-05-19T14:28:58.561Z","dependency_job_id":"3e04b1e6-c64b-48fe-a699-a4bb65d5c6b3","html_url":"https://github.com/HasData/find-urls-from-any-domain","commit_stats":null,"previous_names":["hasdata/find-urls-from-any-domain"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HasData/find-urls-from-any-domain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasData%2Ffind-urls-from-any-domain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasData%2Ffind-urls-from-any-domain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasData%2Ffind-urls-from-any-domain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasData%2Ffind-urls-from-any-domain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HasData","download_url":"https://codeload.github.com/HasData/find-urls-from-any-domain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasData%2Ffind-urls-from-any-domain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32704288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ai-extraction","crawler","hasdata-api","nodejs","python","sitemap-parser","url-extraction","web-crawling","web-scraping"],"created_at":"2025-06-27T01:05:46.417Z","updated_at":"2026-05-06T17:31:58.881Z","avatar_url":"https://github.com/HasData.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Python](https://img.shields.io/badge/python-3.10+-blue)\r\n![Node.js](https://img.shields.io/badge/node.js-18+-green)\r\n\r\n\r\n# Web Crawling \u0026 Scraping Examples (Python \u0026 Node.js)\r\n[![HasData_bannner](banner.png)](https://hasdata.com/)\r\n\r\nThis repository contains practical examples of website link collection using **Python** and **Node.js**. It covers different methods: from basic sitemap parsing with `requests` to crawling entire websites and scraping Google SERPs with HasData’s API.\r\n\r\n## Table of Contents\r\n\r\n1. [Requirements](#requirements)\r\n2. [Project Structure](#project-structure)\r\n3. [Scraping \u0026 Crawling Examples](#scraping--crawling-examples)\r\n   * [Sitemap Scraping (Requests)](#sitemap-scraping-requests)\r\n   * [Sitemap Scraping (HasData)](#sitemap-scraping-hasdata)\r\n   * [Full Website Crawling (HasData)](#full-website-crawling-hasdata)\r\n   * [Crawling with AI Extraction (HasData)](#crawling-with-ai-extraction-hasdata)\r\n   * [Google SERP Scraping (HasData)](#google-serp-scraping-hasdata)\r\n\r\n## Requirements\r\n\r\n**Python 3.10+** or **Node.js 18+**\r\n\r\n### Python Setup\r\n\r\nRequired packages:\r\n\r\n* `requests`\r\n\r\nInstall:\r\n\r\n```bash\r\npip install requests\r\n```\r\n\r\n### Node.js Setup\r\n\r\nRequired packages:\r\n\r\n* `axios`\r\n\r\nInstall:\r\n\r\n```bash\r\nnpm install axios\r\n```\r\n\r\n## Project Structure\r\n\r\n```\r\nweb-scraping-examples/\r\n│\r\n├── python/\r\n│   ├── sitemap_scraper_requests.py\r\n│   ├── sitemap_scraper_hasdata.py\r\n│   ├── crawler_hasdata.py\r\n│   ├── crawler_ai_hasdata.py\r\n│   ├── google_serp_scraper_hasdata.py\r\n│\r\n├── nodejs/\r\n│   ├── sitemap_scraper_requests.js\r\n│   ├── sitemap_scraper_hasdata.js\r\n│   ├── crawler_hasdata.js\r\n│   ├── crawler_ai_hasdata.js\r\n│   ├── google_serp_scraper_hasdata.js\r\n│\r\n└── README.md\r\n```\r\n\r\nEach script is focused on a specific use case. No frameworks. Just clean and minimal examples to get things done.\r\n\r\n## Scraping \u0026 Crawling Examples\r\nRead full article about [scraping URLs from any website](https://hasdata.com/blog/find-all-urls-on-a-domain).\r\n\r\n### Sitemap Scraping (Requests)\r\n\r\nA basic script that fetches and parses a sitemap XML using `requests` and `xml.etree.ElementTree`. No external services involved. Good for simple sites with clean sitemaps.\r\n\r\nChange this data:\r\n\r\n| Parameter     | Description                  | Example                                      |\r\n| ------------- | ---------------------------- | -------------------------------------------- |\r\n| `sitemap_url` | URL of the sitemap to scrape | `'https://demo.nopcommerce.com/sitemap.xml'` |\r\n| `output_file` | File name to save links      | `'sitemap_links.txt'`                        |\r\n\r\n\r\n\r\n### Sitemap Scraping (HasData)\r\n\r\nUses HasData's API to process a sitemap and extract links. Easier to scale, works even if the sitemap is large or spread across multiple files.\r\n\r\nChange this data:\r\n\r\n| Parameter    | Description                  | Example                                      |\r\n| ------------ | ---------------------------- | -------------------------------------------- |\r\n| `API_KEY`    | Your HasData API key         | `'111-1111-11-1'`                            |\r\n| `sitemapUrl` | URL of the sitemap to scrape | `'https://demo.nopcommerce.com/sitemap.xml'` |\r\n\r\n\r\n### Full Website Crawling (HasData)\r\n\r\nLaunches a full crawl of a website using [HasData’s crawler](https://docs.hasdata.com/scrapers/websites-crawler/quickstart). Useful when the sitemap is missing or incomplete. Returns all discovered URLs.\r\n\r\nChange this data:\r\n\r\n| Parameter       | Description                         | Example                            |\r\n| --------------- | ----------------------------------- | ---------------------------------- |\r\n| `API_KEY`       | Your HasData API key                | `'111-1111-11-1'`                  |\r\n| `payload.limit` | Max number of links to collect      | `20`                               |\r\n| `payload.urls`  | List of URLs to crawl               | `['https://demo.nopcommerce.com']` |\r\n| `output_path`   | Filename to save the collected URLs | `'results_\u003cjob_id\u003e.json'`          |\r\n\r\n\r\n\r\n### Crawling with AI Extraction (HasData)\r\n\r\nSame as above, but adds AI-powered content extraction. You can define what kind of data you want from each page using `aiExtractRules`. Great for structured scraping.\r\n\r\nChange this data:\r\n\r\n| Parameter        | Description                        | Example                   | \r\n| ---------------- | ---------------------------------- | ------------------------- | \r\n| `API_KEY`        | Your HasData API key               | `'111-1111-11-1'`         | \r\n| `urls`           | List of URLs to crawl              | `[\"https://example.com\"]` | \r\n| `limit`          | Max number of pages to crawl       | `20`                      | \r\n| `aiExtractRules` | JSON schema for AI content parsing | See script                | \r\n| `outputFormat`   | Desired output format(s)           | `[\"json\", \"text\"]`        | \r\n\r\n### Google SERP Scraping (HasData)\r\n\r\nSends a search query to HasData and gets back links from Google search results. No browser automation needed. Simple and fast way to collect SERP data.\r\n\r\nChange this data:\r\n\r\n| Parameter     | Description                | Example                         |\r\n| ------------- | -------------------------- | ------------------------------- |\r\n| `api_key`     | Your HasData API key       | `'YOUR-API-KEY'`                |\r\n| `query`       | Search query for Google    | `'site:hasdata.com inurl:blog'` |\r\n| `location`    | Search location            | `'Austin,Texas,United States'`  |\r\n| `deviceType`  | Device type for search     | `'desktop'`                     |\r\n| `num_results` | Number of results to fetch | `100`                           |\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasdata%2Ffind-urls-from-any-domain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasdata%2Ffind-urls-from-any-domain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasdata%2Ffind-urls-from-any-domain/lists"}