Skip to content

Commit

Permalink
Merge pull request #129 from mkasprz/patch-1
Browse files Browse the repository at this point in the history
Added 'html.parser' to BeautifulSoup call
  • Loading branch information
goldsmith authored Nov 11, 2016
2 parents 96854a4 + 50bc236 commit 8d364c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wikipedia/wikipedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def __load(self, redirect=True, preload=False):
request = _wiki_request(query_params)
html = request['query']['pages'][pageid]['revisions'][0]['*']

lis = BeautifulSoup(html).find_all('li')
lis = BeautifulSoup(html, 'html.parser').find_all('li')
filtered_lis = [li for li in lis if not 'tocsection' in ''.join(li.get('class', []))]
may_refer_to = [li.a.get_text() for li in filtered_lis if li.a]

Expand Down

0 comments on commit 8d364c3

Please sign in to comment.