Skip to content

Commit

Permalink
Merge pull request #88 from barrust/fix-bs4-findall
Browse files Browse the repository at this point in the history
fix the find_all usage for some parsed properties
  • Loading branch information
barrust committed Oct 25, 2020
2 parents c329f8f + b3e5eb0 commit 70c6ef9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mediawiki/mediawiki.py
Expand Up @@ -22,7 +22,7 @@
from .utilities import memoize

URL = "https://github.com/barrust/mediawiki"
VERSION = "0.6.5"
VERSION = "0.6.6"


class MediaWiki(object):
Expand Down
8 changes: 4 additions & 4 deletions mediawiki/mediawikipage.py
Expand Up @@ -265,7 +265,7 @@ def logos(self):
soup = BeautifulSoup(self.html, "html.parser")
info = soup.find("table", {"class": "infobox"})
if info is not None:
children = info.findAll("", {"class": "image"})
children = info.find_all("a", class_="image")
for child in children:
self._logos.append("https:" + child.img["src"])
return self._logos
Expand All @@ -283,7 +283,7 @@ def hatnotes(self):
if self._hatnotes is None:
self._hatnotes = list()
soup = BeautifulSoup(self.html, "html.parser")
notes = soup.findAll("", {"class": "hatnote"})
notes = soup.find_all("div", class_="hatnote")
if notes is not None:
for note in notes:
tmp = list()
Expand Down Expand Up @@ -513,7 +513,7 @@ def parse_section_links(self, section_title):
Note:
This is a parsing operation and not part of the standard API"""
soup = BeautifulSoup(self.html, "html.parser")
headlines = soup.find_all("span", {"class": "mw-headline"})
headlines = soup.find_all("span", class_="mw-headline")
tmp_soup = BeautifulSoup(section_title, "html.parser")
tmp_sec_title = tmp_soup.get_text().lower()
id_tag = None
Expand Down Expand Up @@ -686,7 +686,7 @@ def _parse_section_links(self, id_tag):
if node.name == "a":
all_links.append(self.__parse_link_info(node))
else:
for link in node.findAll("a"):
for link in node.find_all("a"):
all_links.append(self.__parse_link_info(link))
return all_links

Expand Down

0 comments on commit 70c6ef9

Please sign in to comment.