{"id":15374428,"url":"https://github.com/ivan-sincek/scrapy-scraper","last_synced_at":"2025-04-15T11:32:41.588Z","repository":{"id":209421567,"uuid":"627447992","full_name":"ivan-sincek/scrapy-scraper","owner":"ivan-sincek","description":"Web crawler and scraper based on Scrapy and Playwright's headless browser.","archived":false,"fork":false,"pushed_at":"2025-03-17T09:59:38.000Z","size":89,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T20:51:23.142Z","etag":null,"topics":["bug-bounty","crawler","crawling","downloader","downloading","ethical-hacking","headless-browser","javascript","offensive-security","penetration-testing","python","red-team-engagement","scraper","scraping","scrapy","security","spider","spidering","web","web-penetration-testing"],"latest_commit_sha":null,"homepage":"","language":"Python","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/ivan-sincek.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":"2023-04-13T13:41:53.000Z","updated_at":"2025-03-17T09:58:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"a342f92a-c931-495c-bf24-bff547985ab4","html_url":"https://github.com/ivan-sincek/scrapy-scraper","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"9fa64022ab576e36297e106257e96e25503c6096"},"previous_names":["ivan-sincek/scrapy-scraper"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-sincek%2Fscrapy-scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-sincek%2Fscrapy-scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-sincek%2Fscrapy-scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivan-sincek%2Fscrapy-scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivan-sincek","download_url":"https://codeload.github.com/ivan-sincek/scrapy-scraper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249061173,"owners_count":21206462,"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":["bug-bounty","crawler","crawling","downloader","downloading","ethical-hacking","headless-browser","javascript","offensive-security","penetration-testing","python","red-team-engagement","scraper","scraping","scrapy","security","spider","spidering","web","web-penetration-testing"],"created_at":"2024-10-01T13:58:46.643Z","updated_at":"2025-04-15T11:32:41.582Z","avatar_url":"https://github.com/ivan-sincek.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scrapy Scraper\n\nWeb crawler and scraper based on Scrapy and Playwright's headless browser.\n\nTo use the headless browser specify `-p` option. Browsers, unlike other standard web request libraries, have the ability to render JavaScript encoded HTML content.\n\nTo automatically download and beautify all JavaScript files, including minified ones, specify `-dir downloads` option - where `downloads` is your desired output directory.\n\nFuture plans:\n\n* check if Playwright's Chromium headless browser is installed or not,\n* add option to stop on rate limiting.\n\nResources:\n\n* [scrapy.org](https://scrapy.org) - official\n* [playwright.dev](https://playwright.dev/python/docs/intro) - official\n* [scrapy/scrapy](https://github.com/scrapy/scrapy) - GitHub\n* [scrapy-plugins/scrapy-playwright](https://github.com/scrapy-plugins/scrapy-playwright) - GitHub\n\nTested on Kali Linux v2024.2 (64-bit).\n\nMade for educational purposes. I hope it will help!\n\n## Table of Contents\n\n* [How to Install](#how-to-install)\n\t* [Install Playwright and Chromium](#install-playwright-and-chromium)\n\t* [Standard Install](#standard-install)\n\t* [Build and Install From the Source](#build-and-install-from-the-source)\n* [How to Run](#how-to-run)\n* [Usage](#usage)\n* [Images](#images)\n\n## How to Install\n\n### Install Playwright and Chromium\n\n```bash\npip3 install --upgrade playwright\n\nplaywright install chromium\n```\n\nMake sure each time you upgrade your Playwright dependency to re-install Chromium; otherwise, you might get an error using the headless browser.\n\n### Standard Install\n\n```bash\npip3 install --upgrade scrapy-scraper\n```\n\n### Build and Install From the Source\n\n```bash\ngit clone https://github.com/ivan-sincek/scrapy-scraper \u0026\u0026 cd scrapy-scraper\n\npython3 -m pip install --upgrade build\n\npython3 -m build\n\npython3 -m pip install dist/scrapy-scraper-3.6-py3-none-any.whl\n```\n\n## How to Run\n\nRestricted, crawl only `example.com`, and include only links to `example.com`:\n\n```fundamental\nscrapy-scraper -u https://example.com/home -o results.txt -a random -s 2 -rs -dir js\n```\n\nRestricted, crawl only `example.com`, and include both, links to `example.com` and 3rd party links:\n\n```fundamental\nscrapy-scraper -u https://example.com/home -o results.txt -a random -s 2 -rs -dir js -l\n```\n\nRestricted, crawl everywhere, and include all the links:\n\n```fundamental\nscrapy-scraper -u https://example.com/home -o results.txt -a random -s 2 -rs -dir js -w off\n```\n\n## Usage\n\n```fundamental\nScrapy Scraper v3.6 ( github.com/ivan-sincek/scrapy-scraper )\n\nUsage:   scrapy-scraper -u urls                     -o out         [-dir directory]\nExample: scrapy-scraper -u https://example.com/home -o results.txt [-dir downloads]\n\nDESCRIPTION\n    Crawl and scrape websites\nURLS\n    File containing URLs or a single URL to start crawling and scraping from\n    -u, --urls = urls.txt | https://example.com/home | etc.\nWHITELIST\n    File containing whitelisted domain names to limit the scope\n    Specify 'off' to disable domain whitelisting\n    Default: limit the scope to domain names extracted from the URLs\n    -w, --whitelist = whitelist.txt | off | etc.\nLINKS\n    Include all 3rd party links and sources in the output file\n    -l, --links\nPLAYWRIGHT\n    Use Playwright's headless browser\n    -p, --playwright\nPLAYWRIGHT WAIT\n    Wait time in seconds before fetching the page content\n    -pw, --playwright-wait = 0.5 | 2 | 4 | etc.\nCONCURRENT REQUESTS\n    Number of concurrent requests\n    Default: 30\n    -cr, --concurrent-requests = 30 | 45 | etc.\nCONCURRENT REQUESTS PER DOMAIN\n    Number of concurrent requests per domain\n    Default: 10\n    -crd, --concurrent-requests-domain = 10 | 15 | etc.\nSLEEP\n    Sleep time in seconds between two consecutive requests to the same domain\n    -s, --sleep = 1.5 | 3 | etc.\nRANDOM SLEEP\n    Randomize the sleep time between requests to vary between '0.5 * sleep' and '1.5 * sleep'\n    -rs, --random-sleep\nAUTO THROTTLE\n    Auto throttle concurrent requests based on the load and latency\n    Sleep time is still respected\n    -at, --auto-throttle = 0.5 | 10 | 15 | 45 | etc.\nRETRIES\n    Number of retries per URL\n    Default: 2\n    -rt, --retries = 0 | 4 | etc.\nRECURSION\n    Recursion depth limit\n    Specify '0' for no limit\n    Default: 1\n    -r, --recursion = 0 | 2 | etc.\nREQUEST TIMEOUT\n    Request timeout in seconds\n    Default: 60\n    -t, --request-timeout = 30 | 90 | etc.\nHEADER\n    Specify any number of extra HTTP request headers\n    -H, --header = \"Authorization: Bearer ey...\" | etc.\nCOOKIE\n    Specify any number of extra HTTP cookies\n    -b, --cookie = PHPSESSIONID=3301 | etc.\nUSER AGENT\n    User agent to use\n    Default: Scrapy Scraper/3.6\n    -a, --user-agent = random[-all] | curl/3.30.1 | etc.\nPROXY\n    Web proxy to use\n    -x, --proxy = http://127.0.0.1:8080 | etc.\nDIRECTORY\n    Output directory\n    All extracted JavaScript files will be saved in this directory\n    -dir, --directory = downloads | etc.\nOUT\n    Output file\n    -o, --out = results.txt | etc.\nDEBUG\n    Enable debug output\n    -dbg, --debug\n```\n\n## Images\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/ivan-sincek/scrapy-scraper/blob/main/img/scraping.png\" alt=\"Scraping\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eFigure 1 - Scraping\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivan-sincek%2Fscrapy-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivan-sincek%2Fscrapy-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivan-sincek%2Fscrapy-scraper/lists"}