Pycurl无法连接到主机

时间:2010-03-03 18:22:27

标签: python curl

我正在写一个pycurl脚本,它在linux上运行正常,但在mac os x上我收到错误:

Traceback (most recent call last):
  File "curl.py", line 47, in <module>
    c.perform()
pycurl.error: (7, "couldn't connect to host")

任何帮助?

由于

2 个答案:

答案 0 :(得分:1)

curl.setopt(pycurl.PROXY, "url")
curl.setopt(pycurl.PROXYPORT, 8000)
curl.setopt(pycurl.PROXYTYPE, pycurl.PROXYTYPE_HTTP)

答案 1 :(得分:0)

使用此解决:

c.setopt(pycurl.PROXY, "url")
c.setopt(pycurl.PROXYPORT, 8000)
c.setopt(pycurl.PROXYTYPE, pycurl.PROXYTYPE_HTTP)