WPZA
WPZA

Reputation: 921

Open website and save as image

I am currently using the following code to open a website:

import webbrowser
webbrowser.open('http://test.com')

I am now trying to save the open webpage as a .gif, any advise on how to do this please?

Upvotes: 1

Views: 595

Answers (1)

alecxe
alecxe

Reputation: 473763

How about selenium and its save_screenshot()?

from selenium import webdriver


driver = webdriver.Firefox()
driver.get("http://test.com")

driver.save_screenshot("screenshot.png")

driver.close()

Upvotes: 3

Related Questions