简体   繁体   中英

HTTPError: HTTP Error 403: Forbidden. wget with python

I am using Python with Jupyter Notebook. 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.

The function that is causing the error is:

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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