GSS-Cogs / family-covid-19

0 stars 0 forks source link

Error running main.py for ONS-Personal-and-economic-well-being-in-Great-Britain #177

Open rg5051 opened 4 years ago

rg5051 commented 4 years ago

Running the main.py file for this dataset I got the following error:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-3-56934ea13cb4> in <module>
----> 1 scraper = Scraper(seed="info.json")
      2 scraper

~/.local/share/virtualenvs/databaker-docker-X2PlW9GW/lib/python3.7/site-packages/gssutils/scrape.py in __init__(self, uri, session, seed)
     99             self._dataset_id = parsed_scrape_uri.netloc.replace('.', '/') + parsed_scrape_uri.path
    100         self.update_dataset_uris()
--> 101         self._run()
    102 
    103     def _repr_markdown_(self):

~/.local/share/virtualenvs/databaker-docker-X2PlW9GW/lib/python3.7/site-packages/gssutils/scrape.py in _run(self)
    147 
    148                     # Scrape
--> 149                     scrape(self, tree)
    150                     scraped = True
    151 

~/.local/share/virtualenvs/databaker-docker-X2PlW9GW/lib/python3.7/site-packages/gssutils/scrapers/ons.py in scrape(scraper, tree)
     40     # literally just whatever's in {"description": {"title": <THIS> }}
     41     # and {"description": {"metaDescription": <THIS> }}
---> 42     scraper.dataset.title = landing_page["description"]["title"].strip()
     43     scraper.dataset.description = landing_page["description"]["metaDescription"]
     44 

KeyError: 'description'