Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scraper fails on some CivicPlus sites #91

Closed
DiPierro opened this issue Feb 3, 2021 · 1 comment
Closed

Scraper fails on some CivicPlus sites #91

DiPierro opened this issue Feb 3, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@DiPierro
Copy link
Contributor

DiPierro commented Feb 3, 2021

civic-scraper crashes when site.scrape is called on a few URLS, including this one in Colorado:

url = 'http://co-routtcounty.civicplus.com/AgendaCenter'
site = CivicPlusSite(url)
assets = site.scrape()

Here's the error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.9/site-packages/civic_scraper/platforms/civic_plus/site.py", line 70, in scrape
    file_metadata = self.parser_kls(raw_html).parse()
  File "/opt/homebrew/lib/python3.9/site-packages/civic_scraper/platforms/civic_plus/parser.py", line 21, in parse
    metadata = self._extract_asset_data(divs)
  File "/opt/homebrew/lib/python3.9/site-packages/civic_scraper/platforms/civic_plus/parser.py", line 44, in _extract_asset_data
    cmte_name = self._committee_name(div)
  File "/opt/homebrew/lib/python3.9/site-packages/civic_scraper/platforms/civic_plus/parser.py", line 71, in _committee_name
    div.h2.span.extract()
AttributeError: 'NoneType' object has no attribute 'span'

The same error message appears for:

Let's diagnose why this is crashing and find a fix.

@DiPierro DiPierro added the bug Something isn't working label Feb 3, 2021
@DiPierro DiPierro changed the title Scraper fails on http://co-routtcounty.civicplus.com/AgendaCenter Scraper fails on some CivicPlus sites Feb 3, 2021
@zstumgoren
Copy link
Member

Fixed in #176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants