Logging in and using cookies in pycurl

前端 未结 3 1022
隐瞒了意图╮
隐瞒了意图╮ 2021-02-04 15:45

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:14

    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)

提交回复
热议问题