Module for creating a screenshot of a web page given a URL?

D

dananrg

Is there a Python module that, given a URL, will grab a screenshot of
the web page it goes to? I'd like to be able to feed such a module a
list of URLs from a file.

Thanks very much.
 
R

Rune Strand

Is there a Python module that, given a URL, will grab a screenshot of
the web page it goes to? I'd like to be able to feed such a module a
list of URLs from a file.

Thanks very much.

Not as I know of, but it's easy to write

Something like this quasi-code:

import time,webbrowser
from PIL import ImageGrab

list_of_urls = [''http://www.google.com', 'http://www.egg.net']

for url in list_of_urls:
webbrowser.open(url)
time.sleep(5) # wait for it to load
screen = ImageGrab.grab(coords etc)
screen.save(some_name_in_some_path)

Untestetd, but I'm pretty sure something like this will do.
If you need more control, and on windows, try pywinauto
 
D

dananrg

Untestetd, but I'm pretty sure something like this will do.
If you need more control, and on windows, try pywinauto

I do need it to run on Windows. I'll check out pywinauto. Thanks.
 
C

chemila66

John said:
Note he didn't say you *need* pywinauto to run on Windows.


John

Is there anyway to do the same job in linux?
The ImageGrab doesn't support for linux system.

If anyone knows that, please, reply me. Thanks a lot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top