mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-24 17:24:14 +00:00
fix typos and wording on selector's introduction
This commit is contained in:
parent
28999590fa
commit
1abb1af0c6
@ -208,7 +208,7 @@ XPath expressions are indeed much more powerful. To learn more about XPath we
|
|||||||
recommend `this XPath tutorial <http://www.w3schools.com/XPath/default.asp>`_.
|
recommend `this XPath tutorial <http://www.w3schools.com/XPath/default.asp>`_.
|
||||||
|
|
||||||
For working with XPaths, Scrapy provides a :class:`~scrapy.selector.Selector`
|
For working with XPaths, Scrapy provides a :class:`~scrapy.selector.Selector`
|
||||||
class, it must be instantiated with a :class:`~scrapy.http.HtmlResponse` or
|
class, it is instantiated with a :class:`~scrapy.http.HtmlResponse` or
|
||||||
:class:`~scrapy.http.XmlResponse` object as first argument.
|
:class:`~scrapy.http.XmlResponse` object as first argument.
|
||||||
|
|
||||||
You can see selectors as objects that represent nodes in the document
|
You can see selectors as objects that represent nodes in the document
|
||||||
@ -271,8 +271,9 @@ After the shell loads, you will have the response fetched in a local
|
|||||||
``response`` variable, so if you type ``response.body`` you will see the body
|
``response`` variable, so if you type ``response.body`` you will see the body
|
||||||
of the response, or you can type ``response.headers`` to see its headers.
|
of the response, or you can type ``response.headers`` to see its headers.
|
||||||
|
|
||||||
The shell also pre-instantiate a selector named ``ss``, it automatically choice
|
The shell also pre-instantiate a selector for this response in variable ``ss``,
|
||||||
the best parsing rules (XML vs HTML) based on response's type.
|
the selector automatically chooses the best parsing rules (XML vs HTML) based
|
||||||
|
on response's type.
|
||||||
|
|
||||||
So let's try it::
|
So let's try it::
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user