Authentication Python请求URL包含pdf内容-请求返回空内容

Authentication Python请求URL包含pdf内容-请求返回空内容,authentication,python-requests,user-agent,Authentication,Python Requests,User Agent,我正在请求获取URL,这是一个pdf文档。尝试了不同的组合,每次都得到r.status\u code=200但r.content='' 在浏览器中,我需要登录到该网站才能在此URL查看PDF 但我尝试了使用和不使用标准auth,如下所示,都获得状态200和空内容。还尝试根据更改“用户代理”参数,但仍然没有成功。如果有任何建议,谢谢你 r = requests.get('http://galeriepoggi.com/cspdocs/invoice/reports/facture.php?id=1

我正在请求获取URL,这是一个pdf文档。尝试了不同的组合,每次都得到
r.status\u code=200
r.content=''

在浏览器中,我需要登录到该网站才能在此URL查看PDF

但我尝试了使用和不使用标准auth,如下所示,都获得状态200和空内容。还尝试根据更改“用户代理”参数,但仍然没有成功。如果有任何建议,谢谢你

r = requests.get('http://galeriepoggi.com/cspdocs/invoice/reports/facture.php?id=1079', allow_redirects=True, auth=(user, passw), headers={'User-Agent': 'test'})

给出r.status_code=200/r.content=''

我正在使用Python 2中的请求版本2.23.0

r = requests.get('http://galeriepoggi.com/cspdocs/invoice/reports/facture.php?id=1079', allow_redirects=True)