Skip to content

Commit 70c6ef9

Browse files
authored
Merge pull request #88 from barrust/fix-bs4-findall
fix the find_all usage for some parsed properties
2 parents c329f8f + b3e5eb0 commit 70c6ef9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

mediawiki/mediawiki.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from .utilities import memoize
2323

2424
URL = "https://github.com/barrust/mediawiki"
25-
VERSION = "0.6.5"
25+
VERSION = "0.6.6"
2626

2727

2828
class MediaWiki(object):

mediawiki/mediawikipage.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def logos(self):
265265
soup = BeautifulSoup(self.html, "html.parser")
266266
info = soup.find("table", {"class": "infobox"})
267267
if info is not None:
268-
children = info.findAll("", {"class": "image"})
268+
children = info.find_all("a", class_="image")
269269
for child in children:
270270
self._logos.append("https:" + child.img["src"])
271271
return self._logos
@@ -283,7 +283,7 @@ def hatnotes(self):
283283
if self._hatnotes is None:
284284
self._hatnotes = list()
285285
soup = BeautifulSoup(self.html, "html.parser")
286-
notes = soup.findAll("", {"class": "hatnote"})
286+
notes = soup.find_all("div", class_="hatnote")
287287
if notes is not None:
288288
for note in notes:
289289
tmp = list()
@@ -513,7 +513,7 @@ def parse_section_links(self, section_title):
513513
Note:
514514
This is a parsing operation and not part of the standard API"""
515515
soup = BeautifulSoup(self.html, "html.parser")
516-
headlines = soup.find_all("span", {"class": "mw-headline"})
516+
headlines = soup.find_all("span", class_="mw-headline")
517517
tmp_soup = BeautifulSoup(section_title, "html.parser")
518518
tmp_sec_title = tmp_soup.get_text().lower()
519519
id_tag = None
@@ -686,7 +686,7 @@ def _parse_section_links(self, id_tag):
686686
if node.name == "a":
687687
all_links.append(self.__parse_link_info(node))
688688
else:
689-
for link in node.findAll("a"):
689+
for link in node.find_all("a"):
690690
all_links.append(self.__parse_link_info(link))
691691
return all_links
692692

0 commit comments

Comments
 (0)