Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. pdf.load(page)
  2. label = pdf.pq('LTTextLineHorizontal:contains("Precinct")')
  3. x0 = float(label.attr('x0'))
  4. y0 = float(label.attr('y0'))
  5. x1 = float(label.attr('x1'))
  6. y1 = float(label.attr('y1'))
  7. precinct = pdf.pq('LTTextLineHorizontal:in_bbox("%s, %s, %s, %s")' &
  8. (x0, y0, x1, y1)).text()
  9. df.set_value(page, 'Precinct', precinct)
  10.  
  11. precinct = pdf.pq('LTTextLineHorizontal:in_bbox("%s, %s, %s, %s")' &
  12. (x0, y0, x1, y1)).text()
  13.  
  14. Traceback (most recent call last):File "Scraper.py", line 36, in <module>
  15. (x0, y0, x1, y1)).text()
  16. TypeError: unsupported operand type(s) for &: 'str' and 'tuple'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement