#!/usr/bin/env python
import requests
import lxml.html
import pandas as pd
import sys

URL = "http://www.cdc.gov/zika/geo/united-states.html"

INT_COLS = [ "travel_associated_cases", "locally_acquired_cases" ]
COLS = [ "state_or_territory" ] + INT_COLS

def scrape():
    html = requests.get(URL).content
    dom = lxml.html.fromstring(html)

    table = dom.cssselect("table")[0]
    rows = table.cssselect("tr")

    cells = [ [ td.text_content().strip() 
        for td in tr.cssselect("td") ] 
             for tr in rows ]

    data = [ c for c in cells 
        if sum(len(x) != 0 for x in c) == 3 ]

    df = pd.DataFrame(data, columns=COLS)
    df[INT_COLS] = df[INT_COLS].astype(int)

    return df

if __name__ == "__main__":
    df = scrape()
    df.to_csv(sys.stdout, index=False, encoding="utf-8")

@@ -68,16 +68,26 @@
 s as pd%0A
+import re%0A
 import s
@@ -89,16 +89,16 @@
 ort sys%0A
-
 %0AURL = %22
@@ -257,16 +257,126 @@
 T_COLS%0A%0A
+paren_pat = re.compile(r%22%5C(%5B%5E%5C)%5D+%5C)%22) %0A%0Adef parse_cell(text):%0A    return re.sub(paren_pat, %22%22, text).strip()%0A%0A
 def scra
@@ -544,16 +544,27 @@
 s = %5B %5B 
+parse_cell(
 td.text_
@@ -576,17 +576,9 @@
 nt()
-.strip() 
+)
 %0A   

Update CDC scraper to handle new format