Skip to content

Commit 2e2c00f

Browse files
committed
Keep map only in png screenshot
1 parent 60ae79c commit 2e2c00f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

folium/folium.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ def _to_png(self, delay=3):
318318
driver.get('file:///{path}'.format(path=fname))
319319
driver.maximize_window()
320320
time.sleep(delay)
321-
png = driver.get_screenshot_as_png()
321+
div = driver.find_elements_by_class_name("folium-map")[0]
322+
png = div.screenshot_as_png
322323
driver.quit()
323324
self._png_image = png
324325
return self._png_image

0 commit comments

Comments
 (0)