scrapy-splash icon indicating copy to clipboard operation
scrapy-splash copied to clipboard

How to replace response.body

Open sclswin opened this issue 3 years ago • 0 comments

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

sclswin avatar Jul 28 '20 04:07 sclswin