Skip to content

Instantly share code, notes, and snippets.

@jeremyjbowers
Created March 13, 2013 14:43
Show Gist options
  • Select an option

  • Save jeremyjbowers/5152779 to your computer and use it in GitHub Desktop.

Select an option

Save jeremyjbowers/5152779 to your computer and use it in GitHub Desktop.
Scraping example for Chad Skelton. This one means no mechanize required.
"""
pip install beautifulsoup4==4.1.3 requests==1.1.0
"""
import requests
from bs4 import BeautifulSoup
url = 'https://eservice.pssg.gov.bc.ca/LRA/reporting/public/activeterm.do?method=get'
data = {
'registrationRole': 'all',
'registrationStatus': 'all',
'surName': '',
'partial': 'NO',
'clientName': '',
'clientPartial': 'NO',
'startDateBetween': 'YES',
'startDate': '03/13/1990',
'endDate': '03/13/2013'
}
r = requests.post(url, data=data, verify=False)
soup = BeautifulSoup(r.content)
print soup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment