scrapy-splash
scrapy-splash copied to clipboard
How to replace response.body
function main(splash, args) splash.response_body_enabled = true splash:go{ args.url, headers={ ["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0", ["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8", } } splash:wait(3) splash:on_response(function(response) --The replacement is invalid response.body = 'replace response.body' end) return { html = splash:html(), png = splash:png(), har = splash:har(), } end