remote control firefox with python

N

News123

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.
 
D

Daniel Molina Wegener

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,
 
H

Hans-Peter Jansen

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
 
B

baloan

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
(e-mail address removed)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top