class documentation

class XMLFeedSpider(Spider):

View In Hierarchy

This class intends to be the base class for spiders that scrape from XML feeds.

You can choose whether to parse the file using the 'iternodes' iterator, an 'xml' selector, or an 'html' selector. In most cases, it's convenient to use iternodes, since it's a faster and cleaner.

Method ​_iternodes Undocumented
Method ​_parse Undocumented
Method ​_register​_namespaces Undocumented
Method adapt​_response You can override this function in order to make any changes you want to into the feed before parsing it. This function must return a response.
Method parse​_node This method must be overriden with your custom spider functionality
Method parse​_nodes No summary
Method process​_results No summary
Class Variable iterator Undocumented
Class Variable itertag Undocumented
Class Variable namespaces Undocumented

Inherited from Spider:

Class Method from​_crawler Undocumented
Class Method handles​_request Undocumented
Class Method update​_settings Undocumented
Static Method close Undocumented
Method __init__ Undocumented
Method __str__ Undocumented
Method ​_set​_crawler Undocumented
Method log Log the given message at the given log level
Method make​_requests​_from​_url This method is deprecated.
Method parse Undocumented
Method start​_requests Undocumented
Class Variable custom​_settings Undocumented
Instance Variable crawler Undocumented
Instance Variable name Undocumented
Instance Variable settings Undocumented
Instance Variable start​_urls Undocumented
Property logger Undocumented

Inherited from object_ref (via Spider):

Method __new__ Undocumented
Class Variable __slots__ Undocumented
def _iternodes(self, response):

Undocumented

def _parse(self, response, **kwargs):

Undocumented

def _register_namespaces(self, selector):

Undocumented

def adapt_response(self, response):
You can override this function in order to make any changes you want to into the feed before parsing it. This function must return a response.
def parse_node(self, response, selector):
This method must be overriden with your custom spider functionality
def parse_nodes(self, response, nodes):
This method is called for the nodes matching the provided tag name (itertag). Receives the response and an Selector for each node. Overriding this method is mandatory. Otherwise, you spider won't work. This method must return either an item, a request, or a list containing any of them.
def process_results(self, response, results):
This overridable method is called for each result (item or request) returned by the 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 GUIDs. It receives a list of results and the response which originated that results. It must return a list of results (items or requests).
iterator: str =

Undocumented

itertag: str =

Undocumented

namespaces: tuple =

Undocumented