Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main(splash, args)
- local host = ""
- local port = 0
- local user = ""
- splash.http2_enabled = false
- splash:set_viewport_size(2000, 2000)
- --splash.private_mode_enabled = false
- splash:set_viewport_full()
- splash.images_enabled = false
- splash:set_user_agent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:63.0) Gecko/20100101 Firefox/63.0')
- splash:on_request(function (request)
- print(request.url)
- request:set_header('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
- request:set_header('Accept-Language', 'es-MX,es;q=0.8,en-US;q=0.5,en;q=0.3')
- request:set_header('Accept-Encoding', 'gzip, deflate')
- request:set_header('DNT', '1')
- request:set_header('Connection', 'close')
- request:set_header('Upgrade-Insecure-Requests', '1')
- end)
- assert(splash:go(args.url))
- assert(splash:wait(5.0))
- return {
- html = splash:html(),
- png = splash:png(),
- har = splash:har(),
- cookies = splash:get_cookies(),
- }
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement