SHARE
TWEET

IL Witness Slip summary

a guest May 21st, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/env python2
  2.  
  3. import requests
  4. from lxml import html
  5.  
  6. def main(url, element_id = 'WitnessSlipTabStrip'):
  7.     tree = html.fromstring(requests.get(url).content)
  8.  
  9.     ws_tabs = tree.xpath('.//div[@id="{}"]/ul/li'.format(element_id))
  10.  
  11.     for tab in ws_tabs:
  12.       print tab.text_content()
  13.  
  14. if __name__ == '__main__':
  15.     # URL for witness slips for SB1966 HCA1
  16.     url = 'http://my.ilga.gov/Hearing/WitnessSlipInfo/119887?hearingid=17216&LegislationDocumentId=154212&HCommittees5%2F27%2F2019-page=1&committeeid=0&chamber=H&nodays=7&_=1558384770586'
  17.     # Minimal URL that works
  18.     url = 'http://my.ilga.gov/Hearing/WitnessSlipInfo/119887?hearingid=17216&LegislationDocumentId=154212'
  19.  
  20.     main(url)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top