{"id":23204818,"url":"https://github.com/atia-farha/html-fetcher-script","last_synced_at":"2025-04-05T10:27:06.569Z","repository":{"id":264233245,"uuid":"847798413","full_name":"Atia-Farha/HTML-Fetcher-Script","owner":"Atia-Farha","description":"A Python script that allows users to fetch and optionally save the HTML content from a specified URL using `requests` library.","archived":false,"fork":false,"pushed_at":"2025-01-05T04:24:49.000Z","size":83,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T21:20:18.111Z","etag":null,"topics":["fetch-data","fetcher","fetching","fetching-data","fetching-data-from-server","fetching-data-from-web","html-fetcher","html-fetcher-script","html-scraper","html-scraping","python","python-scraper","python-script","python3","pythonscript","script","web-scraper","web-scraper-python","web-scraping","web-scraping-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Atia-Farha.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-26T15:09:20.000Z","updated_at":"2025-01-13T09:30:06.000Z","dependencies_parsed_at":"2024-12-29T14:31:13.207Z","dependency_job_id":"c498c2c6-cb70-4d17-b377-d722e95144a9","html_url":"https://github.com/Atia-Farha/HTML-Fetcher-Script","commit_stats":null,"previous_names":["atia-farha/html-fetcher-script"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atia-Farha%2FHTML-Fetcher-Script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atia-Farha%2FHTML-Fetcher-Script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atia-Farha%2FHTML-Fetcher-Script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atia-Farha%2FHTML-Fetcher-Script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Atia-Farha","download_url":"https://codeload.github.com/Atia-Farha/HTML-Fetcher-Script/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247321540,"owners_count":20920007,"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":["fetch-data","fetcher","fetching","fetching-data","fetching-data-from-server","fetching-data-from-web","html-fetcher","html-fetcher-script","html-scraper","html-scraping","python","python-scraper","python-script","python3","pythonscript","script","web-scraper","web-scraper-python","web-scraping","web-scraping-python"],"created_at":"2024-12-18T16:29:11.079Z","updated_at":"2025-04-05T10:27:06.562Z","avatar_url":"https://github.com/Atia-Farha.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML Fetcher Script\n\nHTML Fetcher Script is a Python script that allows users to fetch and optionally save the HTML content from a specified URL using `requests` library. This script provides user-friendly prompts for input validation including URL format, timeout value etc. and allows customization of settings like handling redirects and timeout durations. It handles various exceptions to ensure robustness and provides informative error messages to guide the user in case of issues.\n\n## Table of Contents\n\n- [Project Structure](#project-structure)\n- [Features](#features)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n  - [Usage](#usage)\n- [Error Handling](#error-handling)\n- [Reporting Issues](#reporting-issues)\n\n## Project Structure\n\n```plaintext\nHTML-Fetcher-Script/\n├── src/\n│   └── fetch_html.py       # Main Python script\n├── .gitignore              # Ignored files\n├── LICENSE                 # License file\n└── README.md               # Documentation      \n```\n\n## Features\n\n- **Detailed Console Messages:** Guides users through every step with clear instructions and error \n- **Robust Error Handling:** Catches and handles various exceptions like invalid URLs, connection errors, timeouts, and HTTP issues.\n- **URL Validation:** Ensures the entered URL starts with `http://` or `https://`.\n- **Redirect Options:** Allows users to choose whether to follow HTTP redirects.\n- **Timeout Configuration:** Lets users specify a timeout duration (in seconds) for the request.\n- **Fetch HTML:** The script fetches the HTML content from the specified URL and displays the response headers and the HTML content. \n- **HTML Saving:** Provides an option to save the fetched HTML content to a local file and handles overwriting conflicts.\n- **Repeat or Exit:** After completing one request, provides user an option to fetch another URL or exit the program.\n\n## Getting Started\n\n### Prerequisites\n\n- Python 3 (can be downloaded from \u003ca href=\"https://www.python.org/downloads/\" target=\"_blank\"\u003ePython Official website\u003c/a\u003e)\n- `requests` library (can be installed via `pip install requests` in the terminal)\n\n### Installation\n\n1. Clone this repository to your local machine:\n   ```bash\n   git clone https://github.com/Atia-Farha/HTML-Fetcher-Script.git\n   ```\n2. Navigate to the directory containing the script:\n   ```bash\n   cd HTML-Fetcher-Script\n   ```\n\n### Usage\n\n1. Run the `fetch_html.py` file located inside the `src` folder of this project.\n2. Follow the on-screen prompts:\n   - **Enter the website link**: Provide a valid URL starting with `http://` or `https://` (e.g., `https://example.com`).\n   - **Allow redirects:** Specify whether to allow HTTP redirects (`yes` or `no`).\n   - **Set timeout value:** Enter a positive integer for the request timeout in seconds (e.g., `5`, `10`, `12`,...).\n   - **Save HTML content:** Choose whether to save the fetched HTML content to a file (`yes` or `no`).\n3. If saving the file:\n   - Enter a file name.\n   - If the file already exists, you will be prompted to overwrite or choose a different name.\n4. To fetch another URL when prompted, answer `yes` and repeat the same process. To exit the script, answer `no`.\n\n## Error Handling\n\nThe script includes comprehensive error handling for:\n- Invalid URL\n- Content decoding errors\n- HTTP errors\n- Connection errors\n- Timeout errors\n- Chunked encoding errors\n- General request exceptions\n\n## Reporting Issues\n\nIf you encounter any bugs or have suggestions for improvement, please report them in the \u003ca href=\"https://github.com/Atia-Farha/HTML-Fetcher-Script/issues\" target=\"_blank\"\u003eIssues\u003c/a\u003e section of this GitHub repository. I will address them promptly.\n\n## License\nThis script is provided for personal, non-commercial purposes. Commercial use of this software is not permitted. When using this script, credit must be given to the original author. For more details, read [LICENSE file](LICENSE).\n\n---\n\u003cp align=\"center\"\u003e© Originally written by \u003ca href=\"https://github.com/Atia-Farha\" target=\"_blank\"\u003eAtia Farha\u003c/a\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatia-farha%2Fhtml-fetcher-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatia-farha%2Fhtml-fetcher-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatia-farha%2Fhtml-fetcher-script/lists"}