Hi

Just putting together my first xml parser in scrapy and while it works i 
noted a deprecation in the logs and wanted to know what I should be doing 
moving forward. Below is my code this is the warning.


2016-01-24 14:32:04 [py.warnings] WARNING: 
/home/sayth/.virtualenvs/scrapy_xml/local/lib/python2.7/site-packages/scrapy/selector/unified.py:108:
 
ScrapyDeprecationWarning: scrapy.selector.XmlXPathSelector is deprecated, 
instantiate scrapy.Selector instead.
  for x in result]

# -*- coding: utf-8 -*-
import scrapy
from scrapy.selector import Selector
from scrapy.http import HtmlResponse
from scrapy.selector import XmlXPathSelector

class MyxmlSpider(scrapy.Spider):
    name = "myxml"

    start_urls = (
        ["file:///home/sayth/Downloads/20160123RAND0.xml"]
    )

    def parse(self, response):
        xpath = XmlXPathSelector(response)
        for ids in xpath.select('.//race/@id'):
            print(ids.extract())

Thanks


Sayth

-- 
You received this message because you are subscribed to the Google Groups 
"scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to