Skip to content

Commit

Permalink
Merge pull request #175 from sopython/transcript
Browse files Browse the repository at this point in the history
fix transcript parsing
  • Loading branch information
davidism authored Feb 5, 2018
2 parents 5820eea + e71b67a commit ff37c3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions sopy/transcript/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class UpdateTranscriptForm(FlaskForm):
body = TextAreaField('Description')

def process(self, formdata=None, obj=None, data=None, **kwargs):
formdata = self.meta.wrap_formdata(self, formdata)
super().process(formdata, obj, data, **kwargs)

if formdata is not None:
Expand Down
8 changes: 4 additions & 4 deletions sopy/transcript/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def previous_page(current):
# get and parse the new page
r = requests.get(base_url.format(element['href']))
r.raise_for_status()
return BeautifulSoup(r.content, 'lxml')
return BeautifulSoup(r.text, 'lxml')


def next_page(current):
Expand Down Expand Up @@ -74,7 +74,7 @@ def next_page(current):
# get and parse the new page
r = requests.get(base_url.format(element['href']))
r.raise_for_status()
return BeautifulSoup(r.content, 'lxml')
return BeautifulSoup(r.text, 'lxml')


def page_date(page):
Expand All @@ -101,11 +101,11 @@ def get_range(start_id, end_id):
# need to check that the range is in the same room, so fetch start and end pages
r = requests.get(permalink_url.format(start_id))
r.raise_for_status()
page = BeautifulSoup(r.content, 'lxml')
page = BeautifulSoup(r.text, 'lxml')
room_href = page.find('div', id='sidebar-content').find('span', class_='room-name').a['href']
r = requests.get(permalink_url.format(end_id))
r.raise_for_status()
end_page = BeautifulSoup(r.content, 'lxml')
end_page = BeautifulSoup(r.text, 'lxml')

if room_href != end_page.find('div', id='sidebar-content').find('span', class_='room-name').a['href']:
raise ValueError('Start and end are in different rooms.')
Expand Down

0 comments on commit ff37c3c

Please sign in to comment.