Skip to content

Emsalettin1/LuaScraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

LuaScraper

LuaScraper is a lightweight command-line tool built with Lua for downloading the contents of a web page (HTTP or HTTPS) and saving it to a file.

Features

  • Supports both HTTP and HTTPS URLs
  • Saves the response body to a specified output file and filepath
  • Command-line usage, no browser needed
  • Provides error messages for invalid input or network issues

Used Libraries

Installation

  1. Download the LuaScraper.lua from source code
  2. Download the LuaSocket and LuaSec:
luarocks install luasocket
luarocks install luasec

Usage

lua LuaScraper.lua <output_file> <url>
  • <output_file>: The file where the downloaded content will be saved. (you can add a specific filepath)
  • <url>: The URL to fetch (must start with http:// or https://).

Example:

lua LuaScraper.lua example.html https://example.com

Error Handling

  • If the URL is invalid or the protocol is not supported, an error message will be shown.
  • If the HTTP request fails, the status code will be displayed.
  • If the output file cannot be written, an error message will be shown.

License

MIT License

© 2025 Emsalettin1. Contributions welcome.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages