[sitemap] resolve remaining ScrapyDeprecationWarning exceptions
* SgmlLinkExtractor is deprecated * Module `scrapy.contrib.exporter` is deprecated Change-Id: Ie3207a537abfd2b75602000fb4fef8f4c1e8ba56
This commit is contained in:
@@ -14,10 +14,10 @@ import os
|
||||
|
||||
import lxml
|
||||
import scrapy
|
||||
from scrapy.contrib import exporter
|
||||
from scrapy import exporters
|
||||
|
||||
|
||||
class SitemapItemExporter(exporter.XmlItemExporter):
|
||||
class SitemapItemExporter(exporters.XmlItemExporter):
|
||||
'''XmlItemExporer with adjusted attributes for the root element.'''
|
||||
|
||||
def start_exporting(self):
|
||||
|
||||
@@ -15,7 +15,7 @@ import time
|
||||
import urlparse
|
||||
|
||||
from generator import items
|
||||
from scrapy.linkextractors import sgml
|
||||
from scrapy.linkextractors import LinkExtractor
|
||||
from scrapy import spiders
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class SitemapSpider(spiders.CrawlSpider):
|
||||
|
||||
rules = [
|
||||
spiders.Rule(
|
||||
sgml.SgmlLinkExtractor(
|
||||
LinkExtractor(
|
||||
allow=[
|
||||
r'.*\.html',
|
||||
r'.*\.pdf',
|
||||
|
||||
Reference in New Issue
Block a user