简体   繁体   English

HTTPError:HTTP 错误 403:禁止访问。 wget 与 python

[英]HTTPError: HTTP Error 403: Forbidden. wget with python

I am using Python with Jupyter Notebook.我在 Jupyter Notebook 中使用 Python。 This program downloads many pdfs and works on other machines, however when putting it on another machine with Windows Server 2016 Standard it shows an error.该程序下载了许多 pdf 并在其他机器上工作,但是当将它放在另一台装有 Windows Server 2016 Standard 的机器上时,它会显示错误。

The function that is causing the error is:导致错误的 function 是:

def download_doc(pasta_pdf,base_links):
    os.chdir(pasta_pdf)
    for link in base_links['Link_Download_Regulamento']:
        if link != None:           
            wget.download(link)
        else:
            continue

download_doc(pasta_origem,df_regulamentos_novos)

The error print: enter image description here错误打印:在此处输入图像描述

Thanks for your assistance.感谢你的协助。

You got你得到了

HTTPError: HTTP Error 403: Forbidden

If you got information about HTTP response status code, but do not know what it does mean, then you might consult developer.mozilla.org docs , in this case this is 403 Forbidden如果您获得有关 HTTP 响应状态代码的信息,但不知道它是什么意思,那么您可以查阅developer.mozilla.org 文档,在这种情况下是403 Forbidden

The client does not have access rights to the content;客户没有访问内容的权限; that is, it is unauthorized, so the server is refusing to give the requested resource.也就是说,它是未经授权的,因此服务器拒绝提供所请求的资源。 Unlike 401, the client's identity is known to the server.与 401 不同,客户端的身份是服务器已知的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM