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