连接到公司代理后面的公共FTP

2024-06-26 13:32:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在我的工作中访问一个公共FTP,但我得到一个错误。在

这就是我在家里用的密码。在

from ftplib import FTP

ftp = FTP('ftp.cetip.com.br')
ftp.login()
ftp.cwd('/MediaCDI')
ftp.quit()

在我的家里工作很好,但是在我的工作中我遇到了这样的错误:

^{2}$

当我在一个HTTP网站上开发一个scraper时,我使用HTTPProxyAuth和requests为HTTP解决了这个问题。只是想说明一下,这就是代码:

from requests.auth import HTTPProxyAuth
import requests

user = 'xxxx'
password = 'yyyy'

credenciais = HTTPProxyAuth(user, password)
params = {'Dt_Ref': data, 'TpInstFinanceiro': 'CRI', 'Tipo':'1','saida':'txt'}
proxy_access = {'http':'proxy.mywork/accelerated_pac_base.pac'}
url = 'http://www.anbima.com.br/reune/reune_down.asp'


r = requests.post(url, data = params, proxies = proxy_access , auth = credenciais)

有人知道我能做什么吗?在

谢谢


Tags: frombrimportcomauthhttp错误ftp