Advertisement
Guest User

Splash and Crawlera

a guest
Jun 7th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. function use_crawlera(splash)
  2.     splash:on_request(function (request)
  3.         request:set_header("X-Crawlera-UA", "pass")
  4.         request:set_header('X-Crawlera-Cookies', 'disable')
  5.         request:set_proxy{'proxy.crawlera.com', 8010, username='APIKEY', password=''}
  6.     end)
  7. end
  8. function main(splash)
  9.     use_crawlera(splash)
  10.     assert(splash:wait(20))
  11.     return {
  12.         html = splash:html(),
  13.         png = splash:png(),
  14.         har = splash:har(),
  15.     }
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement