Crate knee_scraper

source

Functionsยง

  • Checks for common open directories on the server.
  • Downloads a media file (image or video) and saves it to the local directory.
  • Extracts the domain from a URL for folder naming purposes.
  • Extracts all links from an HTML page, normalizing them to absolute URLs.
  • Fetches and parses the robots.txt file.
  • Fetches a web page and prints the response status, demonstrating cookie handling.
  • Normalizes a link to an absolute URL based on the base URL.
  • Sleeps for a random duration between a given range, mimicking human browsing behavior.
  • Generates a random user-agent string from a predefined list.
  • Executes the entire scraping workflow for the provided URL, including:
  • Scrapes all meaningful content from an HTML page, including text, images, videos, meta tags, and forms.
  • Scrapes for emails and saves them to a file.
  • Scrapes for errors and stack traces in the HTML content.
  • Scrapes JavaScript content for API keys or tokens.