[twill] A word of thanks and a suggestion, inc. tiny bit of code
wilmer _
mail_wilmer at hotmail.com
Sun Dec 4 14:57:30 PST 2005
Hello all,
First of all I must say that I have discovered Twill only about one hour
ago, but I believe I have already fallen in love with it!
Why? It's straightforward and simple to use, and it just helped me code
something I had on my to-do list for a few months now.. but for which I
simply could not find the time. I'm very thankful!
I have used Twill for a use case that has not been mentioned yet, namely a
small webspider to connect to a website, fill in a few forms, and return
some values.
Now, I really hope that the following is not a foolish suggestion for
something that already existed in some form (perhaps I have overlooked
something very obvious :O)
Because I needed some more logic and a connection to a back-end database, I
was very happy that I could use Twill from/via Python. However, at one point
I really needed to have the contents/'raw html' from the page accessed using
the 'go' command.
So I have added the command 'get_page()' (sorry, no time right now to dive
into Darcs):
def get_page():
"""
>> get_page
Return the HTML of the current page.
"""
return browser.get_html()
It's basically the same thing as 'show()', but it returns the browser html
so that it can be used by Python, e.g.: page_data = get_page() ;
doSomethingWith(page_data)
I hope this is a useful suggestion and did I already mention that I'm very
happy with Twill? ;-)
Keep up the great work!
Kind regards,
Wilmer
_________________________________________________________________
Dont just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
More information about the twill
mailing list