Browse Source

[sitemap] resolve remaining ScrapyDeprecationWarning exceptions

* SgmlLinkExtractor is deprecated
* Module `scrapy.contrib.exporter` is deprecated

Change-Id: Ie3207a537abfd2b75602000fb4fef8f4c1e8ba56
tags/0.31.0
Christian Berendt 4 years ago
parent
commit
94d69f1868
2 changed files with 4 additions and 4 deletions
  1. 2
    2
      sitemap/generator/pipelines.py
  2. 2
    2
      sitemap/generator/spiders/sitemap.py

+ 2
- 2
sitemap/generator/pipelines.py View File

@@ -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):

+ 2
- 2
sitemap/generator/spiders/sitemap.py View File

@@ -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',

Loading…
Cancel
Save