多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
~~~lua|woo print('===访问百度首页,并使用正则截取百度首页标题===') print('内部模块http测试,内部模块请使用冒号:开头') -- 引用内部模块:http local http = require(":http") -- 这里可以使用代理来访问,channel=socks or http --http:proxy({ channel = 'socks', host = '127.0.0.1', port = '1288', username = '', password = '' }) response, error_message = http:get("http://www.baidu.com", { query = "page=1", timeout = "30s", headers = { Accept = "*/*", --['user-agent'] = 'chrome ...' }, }) print('错误信息:', error_message) local rule_re = '<title>(.*?)</title>' print('网络正常的情况下,下方代码输出:百度一下,你就知道') _out('访问百度首页并使用正则[' .. rule_re .. ']匹配标题:', _re_match(response.body, rule_re)[1][2]) ~~~