Lua : Fetch a webpage
问题 I want to fetch a webpage and get the result in a string, but I don't know how to do it. I search online and didn't find how to do it. 回答1: I'd simply use Lua Socket which comes with an http submodule. You can simply use http.request to get a webpage into whatever container you'd want (default is string, but you can use a table, a file, stdio, ... using ltn12 filters and sinks). As an example: local http=require'socket.http' local body, statusCode, headers, statusText = http.request('http:/