views:

80

answers:

4

This task is very hard to finish in other programming languages,

what about in MATLAB?

A: 

you could install one of these firefox plugins (along with firefox), make a system call to firefox from your program with the appropriate arguments to firefox, and voila, you have a program that takes screenshots of a web page.

dhoss
A: 

Not sure if you're looking for a pure MATLAB solution. But if you have Python handy, take a look at PyWebShot. Then, you can just call the Python script from MATLAB using the exclamation mark syntax, etc.

ars
Which version of python does it require?Will it work with python 2.5?
It works with Python 2.5. But also take note of the other dependencies in the blog post I linked to and make sure you install those as well.
ars
I'm using windows XP,and I've managed to install python `gtk` package,but I can't get `gtkmozembed` package installed,there is no binary installer available anywhere:(
+4  A: 

I'm not sure if Matlab is the best way to do this, but here's how:

  1. use Matlab's built-in web function to open your webpage in a Matlab browser
  2. Download and use the ScreenCapture utility from the Matlab File Exchange to save a screenshot to file

If you need finer-grained control, you can use Java's java.awt.Robot.createScreenCapture to take a screenshot that you can then save. This can be done from within Matlab (it is actually the basis of the ScreenCapture utility), or from standalone Java code.

Yair Altman
Can it work without actually start up the browser or just start it internally ?
No: to get a screenshot you need it to be visible
Yair Altman
A: 

I have no idea how to do that in MATLAB (nor why would you want to do that in MATLAB, unless it's a part of something larger) ... but there is a specialized plugin for Firefox, for doing just that ... FireShot. Works nicely, no fussing about.

ldigas

related questions