Skip to content

Commit

Permalink
SOMEWHAT MAJOR: Make wiki parser more reliable
Browse files Browse the repository at this point in the history
Change the parser so that it looks for the first-from-last 'pre' tag
instead of the second. This makes it more reliable because there is much
less of a chance that a code box is placed under the list than above it.
  • Loading branch information
guyfawcus committed Nov 22, 2017
1 parent 6966d89 commit 06e4270
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion archmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def get_users(url='https://wiki.archlinux.org/index.php/ArchMap/List', local='')

# Grab the user data between the second set of <pre> tags.
soup = BeautifulSoup(wiki_source, 'html.parser')
wiki_text = soup.find_all('pre')[1].text.strip()
wiki_text = soup.find_all('pre')[-1].text.strip()

return wiki_text

Expand Down

0 comments on commit 06e4270

Please sign in to comment.