duanbimo7212
duanbimo7212
2016-06-24 20:34

使用已创建的cookie通过php脚本获取内容

已采纳

I have regular credentials to access a specific site (built with OpenCMS). Everyday I download (Save AS) a bunch of pages, parse them and extract the data I need. Is there a way to do it via PHP? Maybe using the cookie that's already been set? Or passing credentials in http request? (I tried but seems OpenCMS won't allow that). I've seen something about stream_context_create but I can't figure out how to do it.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • drhrpa2945 drhrpa2945 5年前

    Read up on CURL. You can specify a cookie jar to use, which means you can copy your normal browser cookies into the file CURL is using.

    点赞 评论 复制链接分享

为你推荐