Scrapy, a fast high-level web crawling & scraping framework for Python.
added scrapy.utils.response module
Pablo Hoffman7b2317d9358c
diff --git a/scrapy/trunk/scrapy/utils/response.py b/scrapy/trunk/scrapy/utils/response.pynew file mode 100644index 000000000..63fa3f686--- /dev/null+++ b/scrapy/trunk/scrapy/utils/response.py@@ -0,0 +1,15 @@+"""+This module provides some useful functions for working with+scrapy.http.Response objects+"""++from scrapy.xpath import XPathSelector++def new_response_from_xpaths(response, xpaths):+ """Return a new response constructed by applying the given xpaths to the+ original response body+ """+ xs = XPathSelector(response)+ parts = [''.join([n for n in xs.x(x).extract()]) for x in xpaths]+ new_body = ''.join(parts)+ return response.replace(body=new_body)