开发者

How to script Firefox or any Mozilla based browser [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. 开发者_JS百科

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 3 years ago.

Improve this question

I need to automate something like this:

  1. Open an URL
  2. Wait until the page is fully loaded
  3. Save COMPLETE page as... (I can provide a name).

I saw https://developer.mozilla.org/en/Command_Line_Options but I can't find an option to invoke the command "save page as... (in mode Web page complete)". So I can have all css, js, xml and related files needed to display the page.

I know some Python that I could use it if I find a way to "talk" to Firefox. The webbrowser module is not help here since it doesn't allow to save a page: http://docs.python.org/library/webbrowser.html

I am opened to any kind of solution.

Platform: Linux, but I could use another if there is no other way.

Important: I can't just retrieve the HTML given by the web server, since I need all css, js, images and files that are used to see to page as rendered by the browser. For example an image may be not linked in the HTML but referenced by a js that is executed when the page is rendered. The only way I think that I could retrieve this image is by executing the page as if I were the browser and then get all files from the resulting page (and not the original page).


Maybe something from the Selenium collection of tools works for you.

Selenium IDE is an integrated development environment for Selenium scripts. It is implemented as a Firefox extension, and allows you to record, edit, and debug tests. Selenium IDE includes the entire Selenium Core, allowing you to easily and quickly record and play back tests in the actual environment that they will run.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜