开发者

Python equivalent for curl -b (--cookie)

I wish to convert a bash script that's currently using "curl -b 'coo开发者_高级运维kie'" into a Python script. I've looked at Pycurl, but I couldnt' find a -b equivalent. There are also urllib and urllib2, but I couldn't see an easy way to replicate the line.

Any help would be great.


This should get you started.

http://docs.python.org/library/cookielib.html#cookielib.CookieJar


You can use CookieJar.add_cookie_header to add your cookie to a http request header.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜