Skip to content

Commit ff37c3c

Browse files
authored
Merge pull request #175 from sopython/transcript
fix transcript parsing
2 parents 5820eea + e71b67a commit ff37c3c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

sopy/transcript/forms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class UpdateTranscriptForm(FlaskForm):
6262
body = TextAreaField('Description')
6363

6464
def process(self, formdata=None, obj=None, data=None, **kwargs):
65+
formdata = self.meta.wrap_formdata(self, formdata)
6566
super().process(formdata, obj, data, **kwargs)
6667

6768
if formdata is not None:

sopy/transcript/parser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def previous_page(current):
3939
# get and parse the new page
4040
r = requests.get(base_url.format(element['href']))
4141
r.raise_for_status()
42-
return BeautifulSoup(r.content, 'lxml')
42+
return BeautifulSoup(r.text, 'lxml')
4343

4444

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

7979

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

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

0 commit comments

Comments
 (0)