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

Handle new-style "Web02" Clarity sites #35

Open
dwillis opened this issue Oct 26, 2018 · 11 comments
Open

Handle new-style "Web02" Clarity sites #35

dwillis opened this issue Oct 26, 2018 · 11 comments
Labels

Comments

@dwillis
Copy link
Contributor

dwillis commented Oct 26, 2018

Like West Virginia, which clarify fails to parse and return any information from.

@dwillis dwillis added the bug label Oct 26, 2018
@migurski
Copy link

Is the example for Kentucky a new-style Clarity site? I’m seeing this error when following the README and curious if it’s part of this issue:

>>> import clarify
>>> j = clarify.Jurisdiction(url='http://results.enr.clarityelections.com/KY/15261/30235/en/summary.html', level='state')
>>> j.report_url('xml')
'https://results.enr.clarityelections.com/KY/15261/30235/reports/detailxml.zip'
>>> subs = j.get_subjurisdictions()
>>> subs[0].name
'Boone'
>>> subs[-1].report_url('xml')
'https://results.enr.clarityelections.com/KY/Woodford/15382/27566/reports/detailxml.zip'

(At this point I download and extract the Woodford XML to /tmp/detail.xml)

>>> p = clarify.Parser()
>>> p.parse("/tmp/detail.xml")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/private/tmp/clarify/.venv/lib/python3.6/site-packages/clarify/parser.py", line 47, in parse
    self.voter_turnout = float(election_voter_turnout[2])
IndexError: list index out of range

@dwillis
Copy link
Contributor Author

dwillis commented Oct 29, 2018

@migurski No, Kentucky is an older Clarity site, so this looks like a separate issue. Thanks for flagging it, though!

@migurski
Copy link

Ah cool — is there a current Clarity example that demonstrates working behavior?

@dwillis
Copy link
Contributor Author

dwillis commented Oct 29, 2018

Just updated the README to use one.

@jonrobinson2
Copy link

Oh boo

@cjwinchester
Copy link

Also Colorado, if you need another test case.

@kyoung2112
Copy link

kyoung2112 commented Nov 15, 2018

The README example is Georgia, which uses the new Clarity 'Web02' format for new elections, but the README example is for an older GA election that uses the older summary.html results URL format. The most recent GA election result page is "http://results.enr.clarityelections.com/GA/91639/Web02-state.221451/#/". The "j.report_url('xml')" step from the README does NOT work with the new Web02 format, but "j.get_subjurisdictions()" does work properly. There's a get_latest_summary_url() method that works with Web02, but the report_url() does not use this.

@dwillis
Copy link
Contributor Author

dwillis commented Nov 18, 2018

@kyoung2112 Thanks - we'll get that fixed on j.report_url('xml')

@bxjw
Copy link

bxjw commented Jul 9, 2020

It looks like there's now a new URL format that behaves pretty similarly to the WV and GA cases, but not exactly so it again breaks the code: https://results.enr.clarityelections.com/KY/103779/web.255599/#/reporting

@dwillis
Copy link
Contributor Author

dwillis commented Jul 23, 2020

@bxjw Thanks - just pushed a fix for this but have not done a release yet. If you install directly from GitHub it should work.

@JDWarner
Copy link

JDWarner commented Jan 4, 2021

@dwillis Most 2020 elections are now using the web.XXXXXX URL format, for example the GA 2020 general election here: https://results.enr.clarityelections.com/GA/105369/web.264614/#/summary

Installing from source current as of posting, neither this link nor the KY link posted previously work for j.report_url('xml') - it returns None.

Edit: KY and GA do work for subjurisdictions it just takes a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants