On 2013-06-11 09:35, Matteo Landi wrote:
> It should be possible [1];  have a look at the following snippet:
>
> >>> from webtest import TestRequest
> >>> from webtest import TestResponse
> >>> res = TestResponse(content_type='text/html', body=b'''
> ... <html><body><div id="content">hey!</div></body>''')
> >>> res.request = TestRequest.blank('/')
> >>> res.html
>
> <html><body><div id="content">hey!</div></body></html>
> >>> res.html.__class__
> <class 'BeautifulSoup.BeautifulSoup'>
> >>> res.lxml
> <Element html at ...>
> >>> res.lxml.xpath('//body/div')[0].text
> 'hey!'
>
> Does this solve your issue?

Not sure: How would I fill in a form field found with the xpath
expression and submit the form? This is the missing bit for me.

TIA!

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to