Created
July 4, 2016 10:58
-
-
Save jvmsangkal/6f3504caa8715025fb85b5dc1a9fa656 to your computer and use it in GitHub Desktop.
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
import requests | |
def main(): | |
req = requests.Session() | |
req.headers.update({ | |
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36', | |
'Cookie': 'ASP.NET_SessionId=qelk5t3y0lcdzjdak3f1ujr5', | |
'Host': 'egcap.bluespringsgov.com', | |
'Origin': 'http://egcap.bluespringsgov.com', | |
'Referer': 'http://egcap.bluespringsgov.com/CitizenAccess/Site/Permit/Search', | |
'X-Requested-With': 'XMLHttpRequest' | |
}) | |
payload = { | |
'PermitSearchModel.IssueDateStart': '6/1/2016', | |
'PermitSearchModel.IssueDateStop': '6/30/2016', | |
'CountryTypeID': '0', | |
'County': '', | |
'City': '', | |
'AddressLine1': '', | |
'StreetDirectionPrefixID': '', | |
'AddressLine2': '', | |
'StreetTypeID': '', | |
'StreetDirectionPostfixID': '', | |
'UnitOrSuite': '', | |
'StateID': '', | |
'PostalCode': '', | |
'PermitSearchModel.PermitNumber': '', | |
'PermitSearchModel.ProjectName': '', | |
'PermitSearchModel.PermitTypeID': '', | |
'PermitSearchModel.PermitTypeWorkClassID': '', | |
'PermitSearchModel.ExpirationDateStart': '', | |
'PermitSearchModel.ExpirationDateStop': '', | |
'PermitSearchModel.PermitStatusID': '', | |
'PermitSearchModel.FinalizedDateStart': '', | |
'PermitSearchModel.FinalizedDateStop': '' | |
} | |
res = req.post('http://egcap.bluespringsgov.com/CitizenAccess/Site/Permit/Search/AjaxFormPost', data=payload) | |
grid_payload = { | |
'page': '1', | |
'size': '10' | |
} | |
grid_data = req.post('http://egcap.bluespringsgov.com/CitizenAccess/Site/Permit/Search/_SearchResultGridPopulate?Grid-page=1&Grid-size=10&Grid-CERT_KEYSIZE=&Grid-CERT_SECRETKEYSIZE=&Grid-HTTPS_KEYSIZE=&Grid-HTTPS_SECRETKEYSIZE=', data=grid_payload) | |
print(grid_data.json()) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment