I have a generated url that will need to open up the browser to download the file from the server. I am trying to simulate this download using Python requests library
import requests
url = r'https://www.filedownloadserver.com?docId=7700915281958&projectNumber=aaa'
resp = requests.get(url, verify=False)
with open('test.pdf', 'wb') as file:
file.write(chunk)
the output pdf file is incorrect, from the resp.content, it returns javascript that looks like this
//<script>location.href=('https://login.fileserver.com/login1/?redirect='+encodeURIComponent(location.href));</script> location.href=('https://login.fileserver.com/login1/?redirect='+encodeURIComponent(location.href));
is there anyway I can get the actual file from the above content?