douzhanlie9209 2012-06-05 02:22
浏览 14
已采纳

用PHP以编程方式浏览远程网站

How do I go about programmatically use PHP to access a secure site of a website and pull an image? There is a website that I can login with my username/password. Once logged in, I then have to go to a few different pages before the image is available for download. I am trying to download a POD (Proof of Delivery) image from a carriers website.

Can this be done with CURL?

Unfortunately, I cannot access the image directly because: a) it is in a password protected area b) I think there are session variables being set as you browse, as if i browse to the POD of the consignment, there is no request variables added to the image, so I am thinking the previous page must set a session variable to say "this is the consignment I am currently looking at".

Also- is there any ethical restrictions you guys can see in doing this? If I company lets you login to their website, I can't see why they would care if you are doing it physically or programmatically.

  • 写回答

3条回答 默认 最新

  • dou448172583 2012-06-05 02:25
    关注

    I often use SimpleTest's PHP Scriptable Web Browser for such tasks.

    Regarding your "ethical" question, if you're not breaking any laws and getting the information for personal purposes, nobody should care. Just don't abuse it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图