I want to load a local HTML file using Scrapy Splash and take save it as PNG/JPEG and then delete the HTML file
script = """
splash:go(args.url)
return splash:png()
"""
resp = requests.post('http://localhost:8050/run', json={
'lua_source': script,
'url': 'file://my_file.html'
})
resp.content
It returns me
Failed loading page (Protocol "" is unknown) Network error #301
I have also tried
yield SplashRequest(url=filepath,
callback=self.parse_result,
meta={'filepath': filepath},
args={
'wait': 0.5,
'png': 1,
},
endpoint='render.html',
)
But I get
2020-04-23 12:07:41 [scrapy.downloadermiddlewares.retry] DEBUG: Retrying http://localhost:8050/render.html> (failed 1 times): 502 Bad Gateway