Scrapy, a fast high-level web crawling & scraping framework for Python.
for loops have to have a : at the end of the line
ncp11135f18816428da
diff --git a/docs/topics/selectors.rst b/docs/topics/selectors.rstindex 29755dec0..afdaae6e7 100644--- a/docs/topics/selectors.rst+++ b/docs/topics/selectors.rst@@ -244,17 +244,17 @@ At first, you may be tempted to use the following approach, which is wrong, asit actually extracts all ``<p>`` elements from the document, not only thoseinside ``<div>`` elements::- >>> for p in divs.xpath('//p') # this is wrong - gets all <p> from the whole document+ >>> for p in divs.xpath('//p'): # this is wrong - gets all <p> from the whole document>>> print p.extract()This is the proper way to do it (note the dot prefixing the ``.//p`` XPath)::- >>> for p in divs.xpath('.//p') # extracts all <p> inside+ >>> for p in divs.xpath('.//p'): # extracts all <p> inside>>> print p.extract()Another common case would be to extract all direct ``<p>`` children::- >>> for p in divs.xpath('p')+ >>> for p in divs.xpath('p'):>>> print p.extract()For more details about relative XPaths see the `Location Paths`_ section in the