Skip to content

Commit

Permalink
Merge pull request #145 from Datenschule/always-use-school-spider
Browse files Browse the repository at this point in the history
Make all scrapers extend SchoolSpider
  • Loading branch information
k-nut authored Aug 12, 2024
2 parents a5e157f + 8535e71 commit fb52281
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion jedeschule/spiders/bayern.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from scrapy import Item

from jedeschule.items import School
from jedeschule.spiders.school_spider import SchoolSpider


class BayernSpider(scrapy.Spider):
class BayernSpider(SchoolSpider):
name = "bayern"
start_urls = ['https://gdiserv.bayern.de/srv112940/services/schulstandortebayern-wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetCapabilities']

Expand Down
5 changes: 3 additions & 2 deletions jedeschule/spiders/berlin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import xml.etree.ElementTree as ET

import scrapy
from jedeschule.items import School
from scrapy import Item

from jedeschule.spiders.school_spider import SchoolSpider

class BerlinSpider(scrapy.Spider):

class BerlinSpider(SchoolSpider):
name = "berlin"
start_urls = ['https://gdi.berlin.de/services/wfs/schulen?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&srsname=EPSG:4326&typename=fis:schulen']

Expand Down
3 changes: 0 additions & 3 deletions jedeschule/spiders/schleswig_holstein.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import csv
import json

import scrapy
import scrapy.http
from scrapy import Item

from jedeschule.items import School
Expand Down
2 changes: 1 addition & 1 deletion test_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def sort_dict(data):


def get_clean_item(data):
return set({key: value for key, value in data.items() if value is not None})
return set({key: value for key, value in data.items() if value is not None and key != "update_timestamp"})


def compare_schools(new_school, old_school):
Expand Down

0 comments on commit fb52281

Please sign in to comment.