def soup(self): # lazily load the soup # otherwise we will slow down simple operations if not self._soup: r = get(self.url, self.api) self._soup = BeautifulSoup(r.text, html_parser) return self._soup
def soup(self): if not self._soup: r = get(self.url, self.api) self._soup = BeautifulSoup(r.text, html_parser) return self._soup