Skip to content

Instantly share code, notes, and snippets.

@eapen
Last active May 25, 2017 23:03
Show Gist options
  • Save eapen/9558169 to your computer and use it in GitHub Desktop.
Save eapen/9558169 to your computer and use it in GitHub Desktop.
DMV appointment
from lxml import html
from pprint import pprint
import requests
dmvpayload = {'officeId': 632, 'numberItems': 1, 'taskVR': 'true', 'firstName': 'FNAME', 'lastName': 'LNAME', 'telArea': '123', 'telPrefix': '456', 'telSuffix': '7890', 'resetCheckFields': 'true'}
headers = {'User-Agent': 'oh gist'}
url = 'https://www.dmv.ca.gov/wasapp/foa/findOfficeVisit.do'
r = requests.post(url, headers=headers, data=dmvpayload)
tree = html.fromstring(r.content)
appointment = tree.cssselect("p.alert")[1]
print "Next available appointment is on: " + appointment.text_content()
@eapen
Copy link
Author

eapen commented May 25, 2017

Looks like the DMV now requires JS to be enabled 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment