remote control firefox with python

I wondered whether there is a simpe way to
'remote' control fire fox with python.

With remote controlling I mean:
- enter a url in the title bar and click on it
- create a new tab
- enter another url click on it
- save the html document of this page
- Probably the most difficult one: emulate a click or 'right click' on a
certain button or link of the current page.
- other interesting things would be to be able to enter the master
password from a script
- to enable disable proxy settings while running.

The reason why I want to stay within Firefox and not use any other
'mechanize' frame work is, that the pages I want to automate might
contain a lot of javascript for the construction of the actual page.

On Sunday 28 November 2010, 16:22:33 News123 wrote:
> Hi,
>
>
> I wondered whether there is a simpe way to
> 'remote' control fire fox with python.
>
>
> With remote controlling I mean:
> - enter a url in the title bar and click on it
> - create a new tab
> - enter another url click on it
> - save the html document of this page
> - Probably the most difficult one: emulate a click or 'right click'
> on a certain button or link of the current page.
> - other interesting things would be to be able to enter the master
> password from a script
> - to enable disable proxy settings while running.
>
> The reason why I want to stay within Firefox and not use any other
> 'mechanize' frame work is, that the pages I want to automate might
> contain a lot of javascript for the construction of the actual page.

If webkit based rendering in an option (since its javascript engine is
respected by web developers nowadays..), you might want to check out
PyQt, based on current versions of Qt. It provides very easy access to
a full featured web browser engine without sacrificing low level
details. All your requirements are provided easily (if you're able to
grok the Qt documentation, e.g. ignore all C++ clutter, you're set).

I've transcoded all available QtWebKit examples to python lately,
available here:

On Nov 28, 4:22 pm, News123 <> wrote:
> Hi,
>
> I wondered whether there is a simpe way to
> 'remote' control fire fox with python.
>
> With remote controlling I mean:
> - enter a url in the title bar and click on it
> - create a new tab
> - enter another url click on it
> - save the html document of this page
> - Probably the most difficult one: emulate a click or 'right click' on a
> certain button or link of the current page.
> - other interesting things would be to be able to enter the master
> password from a script
> - to enable disable proxy settings while running.
>
> The reason why I want to stay within Firefox and not use any other
> 'mechanize' frame work is, that the pages I want to automate might
> contain a lot of javascript for the construction of the actual page.
>
> Thanks in advance for any pointers ideas.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!