class TextResponse(Response): (source)
Known subclasses: scrapy.http.response.html.HtmlResponse
, scrapy.http.response.xml.XmlResponse
Undocumented
Method | __init__ |
Undocumented |
Method | css |
Shortcut method implemented only by responses whose content is text (subclasses of TextResponse). |
Method | follow |
Return a :class:`~.Request` instance to follow a link ``url``. It accepts the same arguments as ``Request.__init__`` method, but ``url`` can be not only an absolute URL, but also |
Method | follow |
A generator that produces :class:`~.Request` instances to follow all links in ``urls``. It accepts the same arguments as the :class:`~.Request`'s ``__init__`` method, except that each ``urls`` element does not need to be an absolute URL, it can be any of the following:... |
Method | json |
.. versionadded:: 2.2 |
Method | urljoin |
Join this Response's url with a possible relative url to form an absolute interpretation of the latter. |
Method | xpath |
Shortcut method implemented only by responses whose content is text (subclasses of TextResponse). |
Class Variable | attributes |
A tuple of :class:`str` objects containing the name of all public attributes of the class that are also keyword parameters of the ``__init__`` method. |
Property | encoding |
Undocumented |
Property | selector |
Undocumented |
Property | text |
Body as unicode |
Method | _auto |
Undocumented |
Method | _body |
Undocumented |
Method | _body |
Undocumented |
Method | _bom |
Undocumented |
Method | _declared |
Undocumented |
Method | _headers |
Undocumented |
Method | _set |
Undocumented |
Method | _set |
Undocumented |
Constant | _DEFAULT |
Undocumented |
Instance Variable | _body |
Undocumented |
Instance Variable | _cached |
Undocumented |
Instance Variable | _cached |
Undocumented |
Instance Variable | _cached |
Undocumented |
Instance Variable | _cached |
Undocumented |
Instance Variable | _encoding |
Undocumented |
Instance Variable | _url |
Undocumented |
Inherited from Response
:
Method | __repr__ |
Undocumented |
Method | copy |
Return a copy of this Response |
Method | replace |
Create a new Response with the same attributes except for those given new values |
Class Variable | body |
Undocumented |
Class Variable | url |
Undocumented |
Instance Variable | certificate |
Undocumented |
Instance Variable | flags |
Undocumented |
Instance Variable | headers |
Undocumented |
Instance Variable | ip |
Undocumented |
Instance Variable | protocol |
Undocumented |
Instance Variable | request |
Undocumented |
Instance Variable | status |
Undocumented |
Property | cb |
Undocumented |
Property | meta |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Inherited from object_ref
(via Response
):
Method | __new__ |
Undocumented |
Class Variable | __slots__ |
Undocumented |
scrapy.http.response.Response.css
Shortcut method implemented only by responses whose content is text (subclasses of TextResponse).
Request
:
(source)
¶
scrapy.http.response.Response.follow
Return a :class:`~.Request` instance to follow a link ``url``. It accepts the same arguments as ``Request.__init__`` method, but ``url`` can be not only an absolute URL, but also * a relative URL * a :class:`~scrapy.link.Link` object, e.g. the result of :ref:`topics-link-extractors` * a :class:`~scrapy.selector.Selector` object for a ``<link>`` or ``<a>`` element, e.g. ``response.css('a.my_link')[0]`` * an attribute :class:`~scrapy.selector.Selector` (not SelectorList), e.g. ``response.css('a::attr(href)')[0]`` or ``response.xpath('//img/@src')[0]`` See :ref:`response-follow-example` for usage examples.
Generator[ Request, None, None]
:
(source)
¶
scrapy.http.response.Response.follow_all
A generator that produces :class:`~.Request` instances to follow all links in ``urls``. It accepts the same arguments as the :class:`~.Request`'s ``__init__`` method, except that each ``urls`` element does not need to be an absolute URL, it can be any of the following: * a relative URL * a :class:`~scrapy.link.Link` object, e.g. the result of :ref:`topics-link-extractors` * a :class:`~scrapy.selector.Selector` object for a ``<link>`` or ``<a>`` element, e.g. ``response.css('a.my_link')[0]`` * an attribute :class:`~scrapy.selector.Selector` (not SelectorList), e.g. ``response.css('a::attr(href)')[0]`` or ``response.xpath('//img/@src')[0]`` In addition, ``css`` and ``xpath`` arguments are accepted to perform the link extraction within the ``follow_all`` method (only one of ``urls``, ``css`` and ``xpath`` is accepted). Note that when passing a ``SelectorList`` as argument for the ``urls`` parameter or using the ``css`` or ``xpath`` parameters, this method will not produce requests for selectors from which links cannot be obtained (for instance, anchor tags without an ``href`` attribute)
scrapy.http.response.Response.urljoin
Join this Response's url with a possible relative url to form an absolute interpretation of the latter.
scrapy.http.response.Response.xpath
Shortcut method implemented only by responses whose content is text (subclasses of TextResponse).
scrapy.http.response.Response.attributes
A tuple of :class:`str` objects containing the name of all public attributes of the class that are also keyword parameters of the ``__init__`` method. Currently used by :meth:`Response.replace`.