This task is very hard to finish in othe开发者_开发问答r programming languages,
what about in MATLAB?
I'm not sure if Matlab is the best way to do this, but here's how:
- use Matlab's built-in web function to open your webpage in a Matlab browser
- 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.
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.
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.
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.
精彩评论