Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to replace response.body #265

Open
sclswin opened this issue Jul 28, 2020 · 0 comments
Open

How to replace response.body #265

sclswin opened this issue Jul 28, 2020 · 0 comments

Comments

@sclswin
Copy link

sclswin commented Jul 28, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant