@@ -39,7 +39,7 @@ def previous_page(current):
39
39
# get and parse the new page
40
40
r = requests .get (base_url .format (element ['href' ]))
41
41
r .raise_for_status ()
42
- return BeautifulSoup (r .content , 'lxml' )
42
+ return BeautifulSoup (r .text , 'lxml' )
43
43
44
44
45
45
def next_page (current ):
@@ -74,7 +74,7 @@ def next_page(current):
74
74
# get and parse the new page
75
75
r = requests .get (base_url .format (element ['href' ]))
76
76
r .raise_for_status ()
77
- return BeautifulSoup (r .content , 'lxml' )
77
+ return BeautifulSoup (r .text , 'lxml' )
78
78
79
79
80
80
def page_date (page ):
@@ -101,11 +101,11 @@ def get_range(start_id, end_id):
101
101
# need to check that the range is in the same room, so fetch start and end pages
102
102
r = requests .get (permalink_url .format (start_id ))
103
103
r .raise_for_status ()
104
- page = BeautifulSoup (r .content , 'lxml' )
104
+ page = BeautifulSoup (r .text , 'lxml' )
105
105
room_href = page .find ('div' , id = 'sidebar-content' ).find ('span' , class_ = 'room-name' ).a ['href' ]
106
106
r = requests .get (permalink_url .format (end_id ))
107
107
r .raise_for_status ()
108
- end_page = BeautifulSoup (r .content , 'lxml' )
108
+ end_page = BeautifulSoup (r .text , 'lxml' )
109
109
110
110
if room_href != end_page .find ('div' , id = 'sidebar-content' ).find ('span' , class_ = 'room-name' ).a ['href' ]:
111
111
raise ValueError ('Start and end are in different rooms.' )
0 commit comments