Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Fixups #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions risscraper/scraperallris.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import re
import sys
import time
import unicodedata

from lxml import etree, html
from lxml.cssselect import CSSSelector
Expand Down Expand Up @@ -236,7 +237,7 @@ def find_meeting(self, start_date=None, end_date=None):
""" Find meetings within a given time frame and add them to the meeting
queue.
"""
meeting_find_url = (self.config['scraper']['allris']['meeting_find_url']
meeting_find_url = ("%s/si010_j.asp?kaldatvonbis=%s-%s&selfaction=ws&template=xml&xsl=sikal1"
% (self.config['scraper']['base_url'],
start_date.strftime("%d.%m.%Y"),
end_date.strftime("%d.%m.%Y")))
Expand Down Expand Up @@ -296,7 +297,7 @@ def get_person_organization(self, person_id=None, organization_url=None):
response = self.get_url(url)
if not url:
return
tree = html.fromstring(response.text)
tree = html.fromstring(unicodedata.normalize('NFKD',response.text).encode('ascii','ignore'))

memberships = []
person = Person(originalId=person_id)
Expand Down Expand Up @@ -604,7 +605,7 @@ def get_paper(self, paper_url=None, paper_id=None):
paper_id, paper_url)
return
text = response.text
doc = html.fromstring(text)
doc = html.fromstring(unicodedata.normalize('NFKD',text).encode('ascii','ignore'))
data = {}

# Beratungsfolge-Table checken
Expand Down Expand Up @@ -883,7 +884,7 @@ def get_file(self, file_obj, file_url, post=False):
file_obj.content = file_file.content
# catch strange magic exception
try:
file.mimetype = magic.from_buffer(file_obj.content, mime=True)
file_obj.mimetype = magic.from_buffer(file_obj.content, mime=True)
except magic.MagicException:
logging.warn("Warning: unknown magic error at file %s from %s",
file_obj.originalId, file_url)
Expand Down