duanbimo7212 2016-06-24 12:34
浏览 37
已采纳

使用已创建的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条回答 默认 最新

  • 普通网友 2016-06-24 12:47
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部