remote control firefox with python

Discussion in 'Python' started by News123, Nov 28, 2010.

  1. News123

    News123 Guest

    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.
     
    News123, Nov 28, 2010
    #1
    1. Advertising

  2. News123

    Tim Harig Guest

    On 2010-11-28, News123 <> wrote:
    > Thanks in advance for any pointers ideas.


    google XPCOM
     
    Tim Harig, Nov 28, 2010
    #2
    1. Advertising

  3. News123

    News123 Guest

    On 11/28/2010 06:19 PM, Tim Harig wrote:
    > On 2010-11-28, News123 <> wrote:
    >> Thanks in advance for any pointers ideas.

    >
    > google XPCOM

    thanks a lot
     
    News123, Nov 28, 2010
    #3
  4. On 28 November 2010 15:22, News123 <> wrote:
    >
    > I wondered whether there is a simpe way to
    > 'remote' control fire fox with python.


    Selenium might be worth a look, too:
    <http://code.google.com/p/selenium/wiki/PythonBindings>

    --
    Cheers,
    Simon B.
     
    Simon Brunning, Nov 29, 2010
    #4
  5. On Domingo 28 Noviembre 2010 18:58,
    News123 wrote:

    > On 11/28/2010 06:19 PM, Tim Harig wrote:
    >> On 2010-11-28, News123 <> wrote:
    >>> Thanks in advance for any pointers ideas.

    >>
    >> google XPCOM

    > thanks a lot


    For XPCOM (I've worked with it), you can try the following
    articles and references:

    "XPCOM"
    http://en.wikipedia.org/wiki/XPCOM

    "XPCOM Part 1: An introduction to XPCOM":
    http://www.ibm.com/developerworks/webservices/library/co-xpcom.html

    "XPCOM Part 2: XPCOM component basics":
    http://www.ibm.com/developerworks/webservices/library/co-xpcom2.html

    "XPCOM Part 3: Setting up XPCOM"
    http://www.ibm.com/developerworks/webservices/library/co-xpcom3.html

    "Mozilla Reference Documentation"
    https://developer.mozilla.org/en/XPCOM

    Best regards,
    --
    Daniel Molina Wegener <dmw [at] coder [dot] cl>
    System Programmer & Web Developer
    Phone: +56 (2) 979-0277 | Blog: http://coder.cl/
     
    Daniel Molina Wegener, Nov 29, 2010
    #5
  6. 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:

    http://www.riverbankcomputing.com/pipermail/pyqt/2010-November/028614.html

    The attachment is a tar.bz2 archive, btw.

    Clicking is archived by:

    webelement.evaluateJavaScript(
    "var event = document.createEvent('MouseEvents');"
    "event.initEvent('click', true, true);"
    "this.dispatchEvent(event);"
    )

    Cheers,
    Pete
     
    Hans-Peter Jansen, Nov 30, 2010
    #6
  7. News123

    baloan Guest

    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.


    I have had some good experience with Sikuli.

    http://sikuli.org/

    Regards, Andreas
     
    baloan, Nov 30, 2010
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott
    Replies:
    3
    Views:
    325
    Riccardo Lemmi
    Nov 11, 2008
  2. davidj411
    Replies:
    7
    Views:
    3,375
    Tim Golden
    Oct 8, 2009
  3. Tim Chandler
    Replies:
    0
    Views:
    236
    Tim Chandler
    Oct 7, 2003
  4. Jeff Wood
    Replies:
    7
    Views:
    217
    Jeff Wood
    Oct 18, 2005
  5. Markus Arike
    Replies:
    2
    Views:
    109
    Markus Arike
    Aug 19, 2008
Loading...

Share This Page