Question

I have a list of urls and I wat to create scrennshots with wkhtmltoimage. Some of the urls are redirected to localhost/127.0.0.1 and then I have a screenshot of my localhost (list of directories). How to prevent it?

Was it helpful?

Solution

You can do any of the following:

  1. Configure your webserver (running on localhost) to Show a pretty page with a message you like - so that you get that screenshot instead of list of directories

  2. Configure your webserver (running on localhost) to Return a http error code 404

  3. Cleanup your list to not include any url that resolves to 127.0.0.1, before feeding it to wkhtmltoimage

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top