Skip to content

Commit 906246d

Browse files
committed
Avoid UnicodeDecodeErrors
1 parent 2a35c26 commit 906246d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,13 @@ def load_html_string(self, html_string, new_page=True):
13791379
if soup.body and len(str(soup.body)) > 12:
13801380
found_body = True
13811381
html_body = str(soup.body)
1382+
html_body = html_body.replace("\xc2\xa0", " ")
1383+
html_body = html_body.replace("\xc2\xa1", "¡")
1384+
html_body = html_body.replace("\xc2\xa9", "©")
1385+
html_body = html_body.replace("\xc2\xb7", "·")
1386+
html_body = html_body.replace("\xc2\xbf", "¿")
1387+
html_body = html_body.replace("\xc3\x97", "×")
1388+
html_body = html_body.replace("\xc3\xb7", "÷")
13821389
html_body = re.escape(html_body)
13831390
html_body = self.__escape_quotes_if_needed(html_body)
13841391
html_body = html_body.replace('\\ ', ' ')

0 commit comments

Comments
 (0)