Logging in and using cookies in pycurl

前端 未结 3 1955
夕颜
夕颜 2021-02-04 15:27

I need to download a file that is on a password protected page. To get to the page manually I first have to authenticate via an ordinary login page. I want to use curl to fetc

3条回答
  •  独厮守ぢ
    2021-02-04 16:10

    I believe Curl will store the cookies but you need to use them explicitly. I've only ever used the command line interface for this though. Scanning the documentation I think you might want to try:

    C.setopt(pycurl.COOKIEFILE, 'cookie.txt')
    

    (before the second request)

提交回复
热议问题