Skip to content

Commit bcbb88b

Browse files
committed
Recommend against using 'raw_html' property
1 parent 51e45be commit bcbb88b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

parser.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self, souplib='lxml', testing_mode=False):
3030
logging.info("Testing mode is enabled")
3131

3232
self.soup = None
33-
self.raw_html = None
33+
self._raw_html = None
3434
self.testing_mode = testing_mode
3535
self._souplib = souplib
3636

@@ -48,16 +48,15 @@ def __init__(self, souplib='lxml', testing_mode=False):
4848
def get_raw_html(self):
4949
"""Return the raw HTML BeautifulSoup is currently parsing"""
5050
if self.testing_mode:
51-
return self.raw_html
51+
return self._raw_html
5252
else:
5353
raise Exception ("Can't ask for raw html while not in testing mode")
5454

55-
5655
def update_html(self, html):
5756
"""Feed new data to the parser"""
5857
self.soup = bs4.BeautifulSoup(html, self._souplib)
5958
if self.testing_mode:
60-
self.raw_html = html
59+
self._raw_html = html
6160

6261
def dump_html(self):
6362
"""Dumps the contents of the parser to a file"""

0 commit comments

Comments
 (0)