'I can't submit information on a page
Faced a problem. Can't get data after post request. A blank page comes up. When I do the same thing on the site everything is ok.
import requests
url = "https://tools.usps.com/zip-code-lookup.htm?byaddress"
payload = {'tCompany': 'CARDIOSTART RESALE THRIFT STR', 'tAddress': '435 W CASCADE AVE', 'tCity': 'SISTERS','tState': 'OR', 'tZip-byaddress': '97759'}
r = requests.post(url, payload, allow_redirects=False, headers=HEADERS)
with open("requests_results.html", "wb") as f:
f.write(r.content)
print(r.status_code)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
