{"id":27629248,"url":"https://github.com/samhernandezcdev/hn-web-scraper","last_synced_at":"2026-04-29T15:41:18.455Z","repository":{"id":288336906,"uuid":"967696221","full_name":"samhernandezcdev/hn-web-scraper","owner":"samhernandezcdev","description":"📰 A Python-based web scraper that collects the relevant posts from Hacker News","archived":false,"fork":false,"pushed_at":"2025-04-16T21:53:37.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-17T09:31:33.439Z","etag":null,"topics":["hackernews","python","scraper","selenium"],"latest_commit_sha":null,"homepage":"","language":"Python","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/samhernandezcdev.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-04-16T21:21:53.000Z","updated_at":"2025-04-16T21:58:18.000Z","dependencies_parsed_at":"2025-04-17T10:01:35.042Z","dependency_job_id":"7fe860d7-3f1a-4448-a123-704ab8ffec9f","html_url":"https://github.com/samhernandezcdev/hn-web-scraper","commit_stats":null,"previous_names":["samhernandezcdev/hn-web-scraper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samhernandezcdev%2Fhn-web-scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samhernandezcdev%2Fhn-web-scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samhernandezcdev%2Fhn-web-scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samhernandezcdev%2Fhn-web-scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samhernandezcdev","download_url":"https://codeload.github.com/samhernandezcdev/hn-web-scraper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250457792,"owners_count":21433734,"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":["hackernews","python","scraper","selenium"],"created_at":"2025-04-23T15:15:43.454Z","updated_at":"2026-04-29T15:41:13.431Z","avatar_url":"https://github.com/samhernandezcdev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📰 HackerNews Web Scraper\n\nA Python-based web scraper that collects the relevant posts from [Hacker News](https://news.ycombinator.com/) using `Selenium`, `BeautifulSoup`, and `Requests`. Compiles detailed results, it implements a two-phase system: first it identifies relevant URLs and then performs deep scraping with metadata, saving results in HTML, SQLite and/or CSV.\n\n---\n\n## 🚀 Features (Planned)\n\n- Scanning: Search with Selenium in real time.\n- Extraction: Complete download of the content of each link.\n- Interactive CLI for customized searches.\n- Support for automatic pagination and result limiting.\n- Download of full HTML with Selenium.\n- Scrapes top stories from Hacker News.\n- Parses HTML efficiently using BeautifulSoup.\n- Can be extended for pagination or deeper content.\n- Includes a test suite to validate core functionality.\n- Audible notification at the end of the process.\n\n---\n\n## 🧪 Tests\n\n- Fixtures for temporary databases.\n- HTTP response mocking.\n- Scraping validation and URL processing.\n- Execute tests with:\n\n```bash\n\u003e pytest\n```\n\n## 📦 Installation\n\n### 1. Clone the repository\n\n```bash\n\u003e git clone https://github.com/samhernandezcdev/hn-web-scraper.git\n\u003e cd hn-web-scraper\n```\n\n### 2. Create and activate a virtual environment\nOn macOS/Linux:\n```bash\n\u003e python -m venv venv\n\u003e source venv/Scripts/activate\n```\n\nOn Windows:\n```bash\n\u003e python -m venv venv\n\u003e venv\\Scripts\\activate\n```\n\n### 3. Install dependencies\n```bash\n\u003e pip install -r requirements.txt\n```\n\n\u003e Make sure you have Chrome and **ChromeDriver** installed and available in your system PATH.\n\n## 💻 How to run it?\n```bash\n\u003e python project.py\n```\n\n### Example:\n```markdown\n\u003e Enter your search term: \"Python Web Scraping\"\n\u003e How many elements do you want to scrape?: 50\n\u003e [PROCESSING] Searching in HackerNews...\n\u003e [PAGINATION] Page 1/3 | URLs found: 15/50\n\u003e [RECOPILING] Scrapping individual URLs...\n\u003e [PROGRESS] ████████████████████ 70% | 35/50\n\u003e [STORING] Saving the files...\n    - 50 records in db/2025-04-16_hn_scrape.db\n    - HTMLs in scrapes/2025-04-16_Python_Web_Scraping/\n\u003e [COMPLETED] 3.2 MB of data collected (00:02:17).\n🔔 (sound notification).\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamhernandezcdev%2Fhn-web-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamhernandezcdev%2Fhn-web-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamhernandezcdev%2Fhn-web-scraper/lists"}