Wkhtmltoimage: how to prevent to create pdf/image from localhost/127.0.0.1?

StackOverflow https://stackoverflow.com/questions/19029542

  •  29-06-2022
  •  | 
  •  

Вопрос

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?

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top