Returns the response as a `BeautifulSoup `_ object. Only works with HTML responses; other content-types raise AttributeError.
(self)
| 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): |
no outgoing calls
no test coverage detected