开发者

Python equivalent for curl -b (--cookie)

开发者 https://www.devze.com 2023-03-13 13:21 出处:网络
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

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

精彩评论

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