diff --git a/scraper.py b/scraper.py index bf76ca9..2c73def 100644 --- a/scraper.py +++ b/scraper.py @@ -12,7 +12,9 @@ def licenseConsultations(p): data=[] - t=BeautifulSoup(p).find('div',id='pnlResults').find('table') + t=BeautifulSoup(p).find('div',id='pnlResults') + if t is not None: t=t.find('table') + else: return pd.DataFrame() rows=t.findAll('tr') cells=rows[0].findAll('td') head=[c.text for c in cells]