Python Folium export map error via pdfkit and selenium

333 Views Asked by At

I have to extract Folium map to pgn/img. I've tried a lot of path, via selenium, converting to pdf and reconvert to png, pdfkit, imgkit but nothing worked... Some help?

1

There are 1 best solutions below

0
On

You can do it like this with Selenium :

  1. You create your map with folium as an HTML file
  2. You open your Selenium browser at the url file://{your_folder_path}/{your_HTML_map_file}
  3. You wait for a few seconds in order to use the method save_screenshot() from your Selenium browser