Skip to content

Commit 0f586f0

Browse files
authored
Use lxml over html.parser
1 parent d6b753e commit 0f586f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scpscraper/scpscraper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def get_single_scp(scp_id: str) -> BeautifulSoup:
1313
r = urllib.request.urlopen(url=f'http://scp-wiki.wikidot.com/scp-{scp_id}')
1414

1515
# Return the organized content for parsing.
16-
return BeautifulSoup(r, 'html.parser')
16+
return BeautifulSoup(r, 'lxml')
1717

1818
# Error handling.
1919
except Exception as e:
@@ -34,7 +34,7 @@ def _get_scp_name(scp_id: int) -> str:
3434
# Grab the HTML and parse as needed.
3535
r = urllib.request.urlopen(url=url)
3636
try:
37-
soup = BeautifulSoup(r, 'html.parser')
37+
soup = BeautifulSoup(r, 'lxml')
3838
content = soup.find('div', id='page-content')
3939
list_elements = content.find_all('li')
4040

0 commit comments

Comments
 (0)