Skip to content

Instantly share code, notes, and snippets.



Created Jul 3, 2014
What would you like to do?
USCIS OPT application status query
#!/usr/bin/env python
# vim: set fileencoding=utf-8 ts=4 sw=4 tw=79 :
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import requests
from lxml import etree
from io import StringIO
payload = {
'appReceiptNum': 'SRC1490207645',
if __name__ == '__main__':
s = requests.session()
s.get('', verify=False)
ret ='',
data=payload, verify=False)
tree = etree.parse(StringIO(ret.text), etree.HTMLParser())
n = tree.xpath("//div[@id='caseStatus']"
status = n[0].tail.strip()
if status != 'Initial Review':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.