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.
- 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
- Download the LuaScraper.lua from source code
- Download the LuaSocket and LuaSec:
luarocks install luasocketluarocks install luaseclua 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 withhttp://orhttps://).
Example:
lua LuaScraper.lua example.html https://example.com- 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.
MIT License
© 2025 Emsalettin1. Contributions welcome.