MCPcopy Create free account
hub / github.com/Pylons/webtest / html

Method html

webtest/response.py:390–404  ·  view source on GitHub ↗

Returns the response as a `BeautifulSoup `_ object. Only works with HTML responses; other content-types raise AttributeError.

(self)

Source from the content-addressed store, hash-verified

388
389 @cached_property
390 def html(self):
391 """
392 Returns the response as a `BeautifulSoup
393 <https://www.crummy.com/software/BeautifulSoup/bs3/documentation.html>`_
394 object.
395
396 Only works with HTML responses; other content-types raise
397 AttributeError.
398 """
399 if 'html' not in self.content_type:
400 raise AttributeError(
401 "Not an HTML response body (content-type: %s)"
402 % self.content_type)
403 soup = BeautifulSoup(self.testbody, self.parser_features)
404 return soup
405
406 @property
407 def xml(self):

Callers 2

_parse_formsMethod · 0.95
__init__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected