Created
July 3, 2014 16:19
-
-
Save yegle/e484a17509efce1abb12 to your computer and use it in GitHub Desktop.
USCIS OPT application status query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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('https://egov.uscis.gov/cris/Dashboard/CaseStatus.do', verify=False) | |
ret = s.post('https://egov.uscis.gov/cris/Dashboard/CaseStatus.do', | |
data=payload, verify=False) | |
tree = etree.parse(StringIO(ret.text), etree.HTMLParser()) | |
n = tree.xpath("//div[@id='caseStatus']" | |
"/div[@class='controls']" | |
"/h4/br") | |
status = n[0].tail.strip() | |
if status != 'Initial Review': | |
print(status) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment