Splash 负载均衡配置测试

import requests
from urllib.parse import quote
import re

lua = '''
function main(splash, args)
  local treat = require("treat")
  local response = splash:http_get("http://httpbin.org/get")
  return treat.as_string(response.body)
end
'''

url = 'http://0.0.0.0:8050/execute?lua_source=' + quote(lua)
response = requests.get(url, auth=('admin', 'qq562246926'))
ip = re.search('(\d+\.\d+\.\d+\.\d+)', response.text).group(1)
print(ip)
posted @ 2020-02-26 21:27  LeeHua  阅读(244)  评论(0编辑  收藏  举报