{"id":22740260,"url":"https://github.com/danhilse/web-scraper","last_synced_at":"2025-04-23T21:40:44.478Z","repository":{"id":245475892,"uuid":"818360318","full_name":"danhilse/web-scraper","owner":"danhilse","description":"A versatile Python-based web scraper that extracts content from single URLs or entire sitemaps, organizing data into structured text files. Features include sitemap parsing, content grouping by URL structure, and an easy-to-use command-line interface. Ideal for data extraction, content analysis, and web research tasks.","archived":false,"fork":false,"pushed_at":"2025-03-23T16:23:07.000Z","size":4530,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T17:27:46.661Z","etag":null,"topics":["beautifulsoup","cli-tool","data-extraction","python","sitemap-parser","web-scraping"],"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/danhilse.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}},"created_at":"2024-06-21T17:14:18.000Z","updated_at":"2025-03-23T16:23:10.000Z","dependencies_parsed_at":"2024-06-22T10:05:06.566Z","dependency_job_id":null,"html_url":"https://github.com/danhilse/web-scraper","commit_stats":null,"previous_names":["danhilse/web-scraper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danhilse%2Fweb-scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danhilse%2Fweb-scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danhilse%2Fweb-scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danhilse%2Fweb-scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danhilse","download_url":"https://codeload.github.com/danhilse/web-scraper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250522189,"owners_count":21444507,"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":["beautifulsoup","cli-tool","data-extraction","python","sitemap-parser","web-scraping"],"created_at":"2024-12-10T23:08:02.661Z","updated_at":"2025-04-23T21:40:44.455Z","avatar_url":"https://github.com/danhilse.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# contxt: Web Content Collector for LLM Context\n\nA tool for quickly creating context documents for Large Language Models from web sources.\n\n## Features\n\n- **Intelligent Content Extraction**:\n  - Automatic boilerplate and navigation removal\n  - OpenGraph metadata extraction\n  - Main content identification\n  - List item deduplication\n  - Span concatenation\n  - SVG content cleaning\n\n- **Multiple Scraping Modes**:\n  - Basic: Fast HTML scraping\n  - Advanced: JavaScript support via Selenium\n  - Super: Extended wait time for complex sites\n  \n- **Smart Image Handling**:\n  - Hash-based deduplication\n  - Relative URL resolution\n  - Date-based organization\n  - Dimension extraction\n  \n- **Content Metrics**:\n  - Token counting for LLM context estimation\n  - Processing time tracking\n  \n- **Flexible Output Options**:\n  - **Formats**:\n    - Markdown: Clean, readable format\n    - XML: Structured, machine-readable format\n    - Raw HTML: Cleaned HTML without boilerplate\n  - **Destinations**:\n    - Print to console\n    - Save to file\n    - Copy to clipboard\n    \n- **URL Management**:\n  - Pattern-based URL filtering\n  - Batch processing\n  \n- **User Experience**:\n  - Interactive CLI with color-coded output\n  - Detailed progress tracking\n  - Timing information\n\n## Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/contxt.git\ncd contxt\n\n# Install the package\npip install -e .\n```\n\n## Usage\n\n### Basic Usage\n\n```bash\n# Interactive mode with guided prompts\ncontxt\n\n# Direct mode with URL(s)\ncontxt https://example.com https://another-example.com\n\n# With options\ncontxt https://example.com -m advanced -f markdown -o file -i\n\n# Ignore specific URL patterns\ncontxt https://example.com --ignore-pattern /tags/ --ignore-pattern /categories/\n\n# Custom naming for output files\ncontxt https://example.com -o file --custom-name my_project\n\n# Advanced scraping with image downloading\ncontxt https://example.com -m super -i -o file\n```\n\n### Command-line Options\n\n- **Scraping Options**:\n  - `--mode, -m`: Scraping mode (`basic`, `advanced`, or `super`)\n  - `--include-images, -i`: Include image references and download images when saving to file\n  - `--ignore-pattern`: URL patterns to ignore (can be specified multiple times)\n  - `--no-og-metadata`: Don't extract OpenGraph metadata\n\n- **Output Options**:\n  - `--format, -f`: Output format (`markdown`, `xml`, or `raw`)\n  - `--output, -o`: Output destination (`print`, `file`, or `clipboard`)\n  - `--directory, -d`: Output directory when saving to file\n  - `--single-file, -s`: Combine all URLs into a single file\n  - `--custom-name`: Custom prefix for output files\n\n- **Performance Options**:\n  - `--no-processing-time`: Don't show processing time in output\n  - `--no-token-count`: Don't show token count in output\n\n- **General Options**:\n  - `--config, -c`: Configure default settings\n  - `--verbose, -v`: Enable verbose logging\n  - `--version`: Show version information\n\n### Configuration\n\nDefault settings are stored in `~/.contxt/config.yaml`. You can modify them using the `--config` flag or by editing the file directly.\n\n## Supported Input Sources\n\n- Individual website URLs\n- Multiple URLs processed in batch\n\n## Output Options\n\n- **Formats**:\n  - Markdown: Clean, readable format with preserved formatting\n  - XML: Structured format with metadata and content elements\n  - Raw HTML: Cleaned HTML with unnecessary elements removed\n\n- **Destinations**:\n  - Print to console\n  - Save to file\n  - Copy to clipboard\n\n- **Organization**:\n  - Single file or multiple files\n  - Optional image downloading to /images folder\n\n## Token Counting\n\ncontxt provides token count estimates for the extracted content, helping you understand how much of an LLM's context window your content will use.\n\n## License\n\nMIT License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanhilse%2Fweb-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanhilse%2Fweb-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanhilse%2Fweb-scraper/lists"}