that's awesome! Thank you for this nice addition :)
On Dec 9, 9:58 pm, "Anand Chitipothu" <[email protected]> wrote:
> I have added a browser module to web.py to make testing web.py
> applications easy.
> It is inspired by the mechanize[1] and it uses ClientForm and BeautifulSoup.
>
> [1]:http://wwwsearch.sourceforge.net/mechanize/
>
> Here is an example usage:
>
> b = app.browser()
> b.open('/')
> b.follow_link(text='Login')
>
> b.select_form(name='login')
> b['username'] = 'joe'
> b['password'] = 'secret'
> b.submit()
>
> assert b.path == '/'
> assert 'Welcome joe' in b.get_text()
>
> It is also possible to use the browser module for crawling or testing
> existing websites.
>
> b = web.Browser()
> b.open('http://webpy.org')
> b.follow_link(url_regex='login')
>
> b.select_form(name='login')
> b['username'] = 'joe'
> b['password'] = 'secret'
> b.submit()
>
> assert b.path == '/'
> assert 'Log Out' in b.get_text()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---