Re: scripting browsers from Python



Michele Simionato wrote:

> I would like to know what is available for scripting browsers from
> Python.
> For instance, webbrowser.open let me to perform GET requests, but I
> would like to do POST requests too. I don't want to use urllib to
> emulate a browser, I am interested in checking that browser X really
> works as intended with my application. Any suggestion?

For Konqueror running on KDE, you can use DCOP to control the browser.
There are a couple of different, but related, Python modules that you
can use to do this. See the following page for more information:

http://developer.kde.org/language-bindings/python/

I believe this approach has been used quite successfully with other
KDE applications:

http://www.kde-apps.org/content/show.php?content=18638

You should still be able to automate the browser with just popen2 and
the "dcop" command line tool if you are really desperate. I once had
to resort to this ad-hoc approach in the distant past but, these days,
I'd recommend one of the above modules instead.

David

.



Relevant Pages

  • Re: UI toolkits for Python
    ... >> Another possible scenario I have in mind is to control the Internet ... >> directly from a Python script using DHTML as a language for definition ... >> considered an UI toolkit for use in Python. ...
    (comp.lang.python)
  • Re: can i use the browser to show the result of python
    ... could put the script onto a web server with cgi enabled, ... browser, and see that generated web page. ... of python on that particular server. ... you can use webbrowser module to launch a browser. ...
    (comp.lang.python)
  • Re: object references/memory access
    ... between two python programs on the same machine. ... by the client web browser would improve? ... and connect this to Apache through the ... The CGI script has a file handle, and it is not possible to pass ...
    (comp.lang.python)
  • RE: what python technology for my app?
    ... As CF is a JAVA based technology you get the power of J2EE platform and its ... what python technology for my app? ... and display but I'm not sure how these would work in a browser based ...
    (comp.lang.python)
  • Re: Python Screen Scraper
    ... I am using Firefox. ... so I would like to scrape the result page for each ... interface python with Firefox, forwarding scraped pages to my browser ...
    (comp.lang.python)