Skip to content

Commit

Permalink
Remove PyPDF dependency. PdfMiner is where it's at
Browse files Browse the repository at this point in the history
Fix a small issue with current legislators that broke between my last commit and now.
  • Loading branch information
markolson committed Dec 31, 2009
1 parent f839b42 commit d8b0107
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/mi/get_legislation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from pyutils.legislation import LegislationScraper, NoDataForYear, ScrapeError, Legislator, Bill, Vote

from BeautifulSoup import BeautifulSoup
from pyPdf import PdfFileReader
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter, process_pdf
from pdfminer.pdfdevice import PDFDevice
from pdfminer.converter import TextConverter
from pdfminer.cmap import CMapDB, find_cmap_path
from pdfminer.layout import LAParams

from StringIO import StringIO
import urllib2
import warnings
Expand Down Expand Up @@ -42,6 +42,7 @@ def scrape_current_legislators(self, chamber, year):
if tr.findAll('th') != []: continue
(district, last_name, first_name, party) = tr.findAll('td', limit=4)
if last_name.div.a.font.string is None: continue
if party.div.font.string.strip() == '': continue
last_name = last_name.div.a.font.string.strip()
first_name = first_name.div.a.font.string.strip()
district = district.div.font.string.strip()
Expand Down

0 comments on commit d8b0107

Please sign in to comment.