``
-elements. First you get would get all ``
`` elements::
+elements. First, you would get all ``
`` elements::
>>> divs = hxs.select('//div')
@@ -235,7 +234,7 @@ XPathSelector objects
``response`` is a :class:`~scrapy.http.Response` object that will be used
for selecting and extracting data
- .. method:: XPathSelector.select(xpath)
+ .. method:: select(xpath)
Apply the given XPath relative to this XPathSelector and return a list
of :class:`XPathSelector` objects (ie. a :class:`XPathSelectorList`) with
@@ -243,7 +242,7 @@ XPathSelector objects
``xpath`` is a string containing the XPath to apply
- .. method:: XPathSelector.re(regex)
+ .. method:: re(regex)
Apply the given regex and return a list of unicode strings with the
matches.
@@ -251,12 +250,12 @@ XPathSelector objects
``regex`` can be either a compiled regular expression or a string which
will be compiled to a regular expression using ``re.compile(regex)``
- .. method:: XPathSelector.extract()
+ .. method:: extract()
Return a unicode string with the content of this :class:`XPathSelector`
object.
- .. method:: XPathSelector.extract_unquoted()
+ .. method:: extract_unquoted()
Return a unicode string with the content of this :class:`XPathSelector`
without entities or CDATA. This method is intended to be use for text-only
@@ -264,13 +263,13 @@ XPathSelector objects
:class:`XPathSelector` objects which don't select a textual content (ie. if
they contain tags), the output of this method is undefined.
- .. method:: XPathSelector.register_namespace(prefix, uri)
+ .. method:: register_namespace(prefix, uri)
Register the given namespace to be used in this :class:`XPathSelector`.
Without registering namespaces you can't select or extract data from
non-standard namespaces. See examples below.
- .. method:: XPathSelector.__nonzero__()
+ .. method:: __nonzero__()
Returns ``True`` if there is any real content selected by this
:class:`XPathSelector` or ``False`` otherwise. In other words, the boolean
@@ -284,15 +283,15 @@ XPathSelectorList objects
The :class:`XPathSelectorList` class is subclass of the builtin ``list``
class, which provides a few additional methods.
- .. method:: XPathSelectorList.select(xpath)
+ .. method:: select(xpath)
- Call the :meth:`XPathSelector.re` method for all :class:`XPathSelector`
- objects in this list and return their results flattened, as new
+ Call the :meth:`XPathSelector.select` method for all :class:`XPathSelector`
+ objects in this list and return their results flattened, as a new
:class:`XPathSelectorList`.
- ``xpath`` is the same argument as the one in :meth:`XPathSelector.x`
+ ``xpath`` is the same argument as the one in :meth:`XPathSelector.select`
- .. method:: XPathSelector.re(regex)
+ .. method:: re(regex)
Call the :meth:`XPathSelector.re` method for all :class:`XPathSelector`
objects in this list and return their results flattened, as a list of
@@ -300,13 +299,13 @@ XPathSelectorList objects
``regex`` is the same argument as the one in :meth:`XPathSelector.re`
- .. method:: XPathSelector.extract()
+ .. method:: extract()
- Call the :meth:`XPathSelector.re` method for all :class:`XPathSelector`
+ Call the :meth:`XPathSelector.extract` method for all :class:`XPathSelector`
objects in this list and return their results flattened, as a list of
unicode strings.
- .. method:: XPathSelector.extract_unquoted()
+ .. method:: extract_unquoted()
Call the :meth:`XPathSelector.extract_unoquoted` method for all
:class:`XPathSelector` objects in this list and return their results
@@ -328,8 +327,8 @@ HtmlXPathSelector examples
~~~~~~~~~~~~~~~~~~~~~~~~~~
Here's a couple of :class:`HtmlXPathSelector` examples to illustrate several
-concepts. In all cases we assume there is already a :class:`HtmlPathSelector`
-instanced with a :class:`~scrapy.http.Response` object like this::
+concepts. In all cases, we assume there is already an :class:`HtmlPathSelector`
+instantiated with a :class:`~scrapy.http.Response` object like this::
x = HtmlXPathSelector(html_response)
@@ -371,7 +370,7 @@ XmlXPathSelector examples
Here's a couple of :class:`XmlXPathSelector` examples to illustrate several
concepts. In all cases we assume there is already a :class:`XmlPathSelector`
-instanced with a :class:`~scrapy.http.Response` object like this::
+instantiated with a :class:`~scrapy.http.Response` object like this::
x = HtmlXPathSelector(xml_response)
diff --git a/docs/topics/settings.rst b/docs/topics/settings.rst
index 33f8a2f8c..7f5aba5c7 100644
--- a/docs/topics/settings.rst
+++ b/docs/topics/settings.rst
@@ -10,11 +10,11 @@ Settings
The Scrapy settings allows you to customize the behaviour of all Scrapy
components, including the core, extensions, pipelines and spiders themselves.
-The infrastructure of setting provides a global namespace of key-value mappings
+The infrastructure of the settings provides a global namespace of key-value mappings
that the code can use to pull configuration values from. The settings can be
populated through different mechanisms, which are described below.
-The settings is also the mechanism for selecting the currently active Scrapy
+The settings are also the mechanism for selecting the currently active Scrapy
project (in case you have many).
For a list of available built-in settings see: :ref:`topics-settings-ref`.
@@ -46,13 +46,13 @@ precedence:
4. Default settings per-command
5. Default global settings (less precedence)
-This mechanisms are described with more detail below.
+These mechanisms are described in more detail below.
1. Global overrides
-------------------
-Global overrides are the ones that takes most precedence, and are usually
-populated by command line options.
+Global overrides are the ones that take most precedence, and are usually
+populated by command-line options.
Example::
>>> from scrapy.conf import settings
@@ -163,7 +163,7 @@ to do that you'll have to use one of the following methods:
.. method:: Settings.getlist(name, default=None)
Get a setting value as a list. If the setting original type is a list it
- will be returned verbatim. If it's a string it will be splitted by ",".
+ will be returned verbatim. If it's a string it will be split by ",".
For example, settings populated through environment variables set to
``'one,two'`` will return a list ['one', 'two'] when using this method.
@@ -245,7 +245,7 @@ COMMANDS_MODULE
Default: ``''`` (empty string)
A module to use for looking for custom Scrapy commands. This is used to add
-custom command for your Scrapy project.
+custom commands for your Scrapy project.
Example::
@@ -530,7 +530,7 @@ Default::
'scrapy.contrib.closedomain.CloseDomain': 0,
}
-The list of available extensions. Keep in mind that some of them need need to
+The list of available extensions. Keep in mind that some of them need to
be enabled through a setting. By default, this setting contains all stable
built-in extensions.
@@ -553,7 +553,7 @@ GROUPSETTINGS_MODULE
Default: ``''`` (empty string)
-The module to use for pulling settings from, if the group settings is enabled.
+The module to use for pulling settings from, if group settings are enabled.
.. setting:: ITEM_PIPELINES
@@ -740,7 +740,7 @@ spider.
This randomization decreases the chance of the crawler being detected (and
subsequently blocked) by sites which analyze requests looking for statistically
-significant similarities in the time between their times.
+significant similarities in the time between their requests.
The randomization policy is the same used by `wget`_ ``--random-wait`` option.
@@ -966,7 +966,7 @@ STATSMAILER_RCPTS
Default: ``[]`` (empty list)
-Send Scrapy stats after domains finish scrapy. See
+Send Scrapy stats after domains finish scraping. See
:class:`~scrapy.contrib.statsmailer.StatsMailer` for more info.
.. setting:: TELNETCONSOLE_ENABLED
@@ -1019,6 +1019,6 @@ USER_AGENT
Default: ``"%s/%s" % (BOT_NAME, BOT_VERSION)``
-The default User-Agent to use when crawling, unless overrided.
+The default User-Agent to use when crawling, unless overridden.
.. _Amazon web services: http://aws.amazon.com/
diff --git a/docs/topics/shell.rst b/docs/topics/shell.rst
index 85690a74a..87dc27d51 100644
--- a/docs/topics/shell.rst
+++ b/docs/topics/shell.rst
@@ -14,14 +14,14 @@ data they extract from the web pages you're trying to scrape. It allows you to
interactively test your XPaths while you're writing your spider, without having
to run the spider to test every change.
-Once you get familiarized with the Scrapy shell you'll see that it's an
+Once you get familiarized with the Scrapy shell, you'll see that it's an
invaluable tool for developing and debugging your spiders.
If you have `IPython`_ installed, the Scrapy shell will use it (instead of the
-standard Python console). The `IPython`_ console is a much more powerful and
+standard Python console). The `IPython`_ console is much more powerful and
provides smart auto-completion and colorized output, among other things.
-We highly recommend you to install `IPython`_, specially if you're working on
+We highly recommend you install `IPython`_, specially if you're working on
Unix systems (where `IPython`_ excels). See the `IPython installation guide`_
for more info.
@@ -72,11 +72,11 @@ content).
Those objects are:
* ``spider`` - the Spider which is known to handle the URL, or a
- :class:`~scrapy.spider.BaseSpider` object if there is no spider is found for
+ :class:`~scrapy.spider.BaseSpider` object if there is no spider found for
the current URL
* ``request`` - a :class:`~scrapy.http.Request` object of the last fetched
- page. You can modify this request using :meth:`~scrapy.http.Request.replace`
+ page. You can modify this request using :meth:`~scrapy.http.Request.replace` or
fetch a new request (without leaving the shell) using the ``fetch``
shortcut.
@@ -125,7 +125,7 @@ all start with the ``[s]`` prefix)::
>>>
-After that, we can stary playing with the objects::
+After that, we can star playing with the objects::
>>> hxs.select("//h2/text()").extract()[0]
u'Welcome to Scrapy'
@@ -164,7 +164,7 @@ Here's an example of how you would call it from your spider::
# ... your parsing code ..
-When you the spider you will get something similar to this::
+When you run the spider, you will get something similar to this::
2009-08-27 19:15:25-0300 [example.com] DEBUG: Crawled (referer: )
2009-08-27 19:15:26-0300 [example.com] DEBUG: Crawled (referer: )
diff --git a/docs/topics/signals.rst b/docs/topics/signals.rst
index 25fc100f1..ceda30023 100644
--- a/docs/topics/signals.rst
+++ b/docs/topics/signals.rst
@@ -137,7 +137,7 @@ spider_closed
:type spider: :class:`~scrapy.spider.BaseSpider` object
:param reason: a string which describes the reason why the spider was closed. If
- it was closed because the spider has completed scraping, it the reason
+ it was closed because the spider has completed scraping, the reason
is ``'finished'``. Otherwise, if the spider was manually closed by
calling the ``close_spider`` engine method, then the reason is the one
passed in the ``reason`` argument of that method (which defaults to
diff --git a/docs/topics/spider-middleware.rst b/docs/topics/spider-middleware.rst
index 2889378cd..da3c9d5f9 100644
--- a/docs/topics/spider-middleware.rst
+++ b/docs/topics/spider-middleware.rst
@@ -7,7 +7,7 @@ Spider Middleware
The spider middleware is a framework of hooks into Scrapy's spider processing
mechanism where you can plug custom functionality to process the requests that
are sent to :ref:`topics-spiders` for processing and to process the responses
-and item that are generated from spiders.
+and items that are generated from spiders.
.. _topics-spider-middleware-setting:
diff --git a/docs/topics/spiders.rst b/docs/topics/spiders.rst
index fafd76788..d42c8b24d 100644
--- a/docs/topics/spiders.rst
+++ b/docs/topics/spiders.rst
@@ -22,21 +22,21 @@ For spiders, the scraping cycle goes through something like this:
:attr:`~scrapy.spider.BaseSpider.parse` method as callback function for the
Requests.
-2. In the callback function you parse the response (web page) and return either
+2. In the callback function, you parse the response (web page) and return either
:class:`~scrapy.item.Item` objects, :class:`~scrapy.http.Request` objects,
or an iterable of both. Those Requests will also contain a callback (maybe
- the same) and will then be followed by downloaded by Scrapy and then their
- response handled to the specified callback.
+ the same) and will then be downloaded by Scrapy and then their
+ response handled by the specified callback.
-3. In callback functions you parse the page contants, typically using
+3. In callback functions, you parse the page contents, typically using
:ref:`topics-selectors` (but you can also use BeautifuSoup, lxml or whatever
mechanism you prefer) and generate items with the parsed data.
-4. Finally the items returned from the spider will be typically persisted in
+4. Finally, the items returned from the spider will be typically persisted in
some Item pipeline.
-Even though this cycles applies (more or less) to any kind of spider, there are
-different kind of default spiders bundled into Scrapy for different purposes.
+Even though this cycle applies (more or less) to any kind of spider, there are
+different kinds of default spiders bundled into Scrapy for different purposes.
We will talk about those types here.
@@ -45,7 +45,7 @@ We will talk about those types here.
Built-in spiders reference
==========================
-For the examples used in the following spiders reference we'll assume we have a
+For the examples used in the following spiders reference, we'll assume we have a
``TestItem`` declared in a ``myproject.items`` module, in your project::
from scrapy.item import Item
@@ -89,7 +89,7 @@ BaseSpider
.. attribute:: start_urls
- Is a list of URLs where the spider will begin to crawl from, when no
+ A list of URLs where the spider will begin to crawl from, when no
particular URLs are specified. So, the first pages downloaded will be those
listed here. The subsequent URLs will be generated successively from data
contained in the start URLs.
@@ -109,7 +109,7 @@ BaseSpider
generate Requests for each url in :attr:`start_urls`.
If you want to change the Requests used to start scraping a domain, this is
- the method to override. For example, if you need to start by login in using
+ the method to override. For example, if you need to start by logging in using
a POST request, you could do::
def start_requests(self):
@@ -213,7 +213,7 @@ CrawlSpider
provides a convenient mechanism for following links by defining a set of rules.
It may not be the best suited for your particular web sites or project, but
it's generic enough for several cases, so you can start from it and override it
- as need more custom functionality, or just implement your own spider.
+ as needed for more custom functionality, or just implement your own spider.
Apart from the attributes inherited from BaseSpider (that you must
specify), this class supports a new attribute:
@@ -222,7 +222,7 @@ CrawlSpider
Which is a list of one (or more) :class:`Rule` objects. Each :class:`Rule`
defines a certain behaviour for crawling the site. Rules objects are
- described below .
+ described below.
Crawling rules
~~~~~~~~~~~~~~
@@ -240,7 +240,7 @@ Crawling rules
``cb_kwargs`` is a dict containing the keyword arguments to be passed to the
callback function
- ``follow`` is a boolean which specified if links should be followed from each
+ ``follow`` is a boolean which specifies if links should be followed from each
response extracted with this rule. If ``callback`` is None ``follow`` defaults
to ``True``, otherwise it default to ``False``.
@@ -306,7 +306,7 @@ XMLFeedSpider
whole DOM at once in order to parse it. However, using ``html`` as the
iterator may be useful when parsing XML with bad markup.
- For setting the iterator and the tag name, you must define the following class
+ To set the iterator and the tag name, you must define the following class
attributes:
.. attribute:: iterator
@@ -356,9 +356,9 @@ XMLFeedSpider
.. method:: adapt_response(response)
A method that receives the response as soon as it arrives from the spider
- middleware and before start parsing it. It can be used used for modifying
+ middleware, before the spider starts parsing it. It can be used to modify
the response body before parsing it. This method receives a response and
- returns response (it could be the same or another one).
+ also returns a response (it could be the same or another one).
.. method:: parse_node(response, selector)
@@ -375,13 +375,13 @@ XMLFeedSpider
spider, and it's intended to perform any last time processing required
before returning the results to the framework core, for example setting the
item IDs. It receives a list of results and the response which originated
- that results. It must return a list of results (Items or Requests)."""
+ those results. It must return a list of results (Items or Requests).
XMLFeedSpider example
~~~~~~~~~~~~~~~~~~~~~
-These spiders are pretty easy to use, let's have at one example::
+These spiders are pretty easy to use, let's have a look at one example::
from scrapy import log
from scrapy.contrib.spiders import XMLFeedSpider
@@ -403,7 +403,7 @@ These spiders are pretty easy to use, let's have at one example::
item['description'] = node.select('description').extract()
return item
-Basically what we did up there was creating a spider that downloads a feed from
+Basically what we did up there was to create a spider that downloads a feed from
the given ``start_urls``, and then iterates through each of its ``item`` tags,
prints them out, and stores some random data in an :class:`~scrapy.item.Item`.
@@ -416,22 +416,22 @@ CSVFeedSpider
over rows, instead of nodes. The method that gets called in each iteration
is :meth:`parse_row`.
- .. attribute:: CSVFeedSpider.delimiter
+ .. attribute:: delimiter
A string with the separator character for each field in the CSV file
Defaults to ``','`` (comma).
- .. attribute:: CSVFeedSpider.headers
+ .. attribute:: headers
- A list of the rows contained in the file CSV feed which will be used for
- extracting fields from it.
+ A list of the rows contained in the file CSV feed which will be used to
+ extract fields from it.
- .. method:: CSVFeedSpider.parse_row(response, row)
+ .. method:: parse_row(response, row)
Receives a response and a dict (representing each row) with a key for each
provided (or detected) header of the CSV file. This spider also gives the
opportunity to override ``adapt_response`` and ``process_results`` methods
- for pre and post-processing purposes.
+ for pre- and post-processing purposes.
CSVFeedSpider example
~~~~~~~~~~~~~~~~~~~~~
diff --git a/docs/topics/stats.rst b/docs/topics/stats.rst
index 34a3c8b7c..81021f230 100644
--- a/docs/topics/stats.rst
+++ b/docs/topics/stats.rst
@@ -121,7 +121,7 @@ class (which they all inherit from).
Get all stats from the given spider (if spider is given) or all global
stats otherwise, as a dict. If spider is not opened ``KeyError`` is
- raied.
+ raised.
.. method:: set_value(key, value, spider=None)
@@ -146,7 +146,7 @@ class (which they all inherit from).
Set the given value for the given key only if current value for the
same key is lower than value. If there is no current value for the
- given key, the value is always set. If spider is not given the global
+ given key, the value is always set. If spider is not given, the global
stats table is used, otherwise the spider-specific stats table is used,
which must be opened or a KeyError will be raised.
@@ -154,7 +154,7 @@ class (which they all inherit from).
Set the given value for the given key only if current value for the
same key is greater than value. If there is no current value for the
- given key, the value is always set. If spider is not given the global
+ given key, the value is always set. If spider is not given, the global
stats table is used, otherwise the spider-specific stats table is used,
which must be opened or a KeyError will be raised.
@@ -191,7 +191,7 @@ Available Stats Collectors
Besides the basic :class:`StatsCollector` there are other Stats Collectors
available in Scrapy which extend the basic Stats Collector. You can select
which Stats Collector to use through the :setting:`STATS_CLASS` setting. The
-default Stats Collector is the :class:`MemoryStatsCollector` is used.
+default Stats Collector used is the :class:`MemoryStatsCollector`.
When stats are disabled (through the :setting:`STATS_ENABLED` setting) the
:setting:`STATS_CLASS` setting is ignored and the :class:`DummyStatsCollector`
@@ -220,7 +220,7 @@ DummyStatsCollector
.. class:: DummyStatsCollector
A Stats collector which does nothing but is very efficient. This is the
- Stats Collector used when stats are diabled (through the
+ Stats Collector used when stats are disabled (through the
:setting:`STATS_ENABLED` setting).
SimpledbStatsCollector
@@ -237,17 +237,17 @@ SimpledbStatsCollector
:setting:`STATS_SDB_DOMAIN` setting. The domain will be created if it
doesn't exist.
- In addition to the existing stats keys the following keys are added at
+ In addition to the existing stats keys, the following keys are added at
persitance time:
* ``spider``: the spider name (so you can use it later for querying stats
for that spider)
- * ``timestamp``: the timestamp when the stats were persisited
+ * ``timestamp``: the timestamp when the stats were persisted
- Both the ``spider`` and ``timestamp`` are used for generating the SimpleDB
+ Both the ``spider`` and ``timestamp`` are used to generate the SimpleDB
item name in order to avoid overwriting stats of previous scraping runs.
- As `required by SimpleDB`_, datetime's are stored in ISO 8601 format and
+ As `required by SimpleDB`_, datetimes are stored in ISO 8601 format and
numbers are zero-padded to 16 digits. Negative numbers are not currently
supported.
@@ -276,7 +276,7 @@ STATS_SDB_ASYNC
Default: ``False``
-If ``True`` communication with SimpleDB will be performed asynchronously. If
+If ``True``, communication with SimpleDB will be performed asynchronously. If
``False`` blocking IO will be used instead. This is the default as using
asynchronous communication can result in the stats not being persisted if the
Scrapy engine is shut down in the middle (for example, when you run only one
@@ -295,7 +295,7 @@ functionality:
.. function:: stats_spider_opened(spider)
Sent right after the stats spider is opened. You can use this signal to add
- startup stats for spider (example: start time).
+ startup stats for the spider (example: start time).
:param spider: the stats spider just opened
:type spider: str
@@ -318,7 +318,7 @@ functionality:
Sent right after the stats spider is closed. You can use this signal to
collect resources, but not to add any more stats as the stats spider has
- already been close (use :signal:`stats_spider_closing` for that instead).
+ already been closed (use :signal:`stats_spider_closing` for that instead).
:param spider: the stats spider just closed
:type spider: str
diff --git a/docs/topics/telnetconsole.rst b/docs/topics/telnetconsole.rst
index 8fd414d2d..99b6e627e 100644
--- a/docs/topics/telnetconsole.rst
+++ b/docs/topics/telnetconsole.rst
@@ -64,15 +64,15 @@ convenience:
.. _pprint.pprint: http://docs.python.org/library/pprint.html#pprint.pprint
-Some example of using the telnet console
-========================================
+Telnet console usage examples
+=============================
Here are some example tasks you can do with the telnet console:
View engine status
------------------
-You can use the ``st()`` method of the Scrapy engine to quickly show its state
+You can use the ``est()`` method of the Scrapy engine to quickly show its state
using the telnet console::
telnet localhost 6023
@@ -105,8 +105,8 @@ using the telnet console::
len(self._scraping[domain]) : 0
-Pause, resume and stop Scrapy engine
-------------------------------------
+Pause, resume and stop the Scrapy engine
+----------------------------------------
To pause::