Issue
How can I modify the args so it captures the entire page
def start_requests(self):
url =#some url
splash_args = {
'html': 1,
'png': 1,
'width': 600,
}
yield SplashRequest(url=url, callback=self.parse,
endpoint="render.json",
args=splash_args)
def parse(self, response):
imgdata = base64.b64decode(response.data['png'])
filename = 'image.png'
with open(filename, 'wb') as f:
f.write(imgdata)
I tried adding 'height' in splash_args the image does get width*height but the extra height is blank, is there any way to solve this?
Solution
You can capture the entire page by adding following line to your Lua script
splash:set_viewport_full()
Answered By - Savvy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.