@@ -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
4545def 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
8080def 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