dongyuan9892 2016-11-09 19:19
浏览 30

如何使用PHP读取带有POST输入的外部页面?

I'm building a php 'web crawler' to populate a database with housing records which I then want to use for analysis. The problem is that the website that I'm trying to access has 2 pages:

  • on the first, I need to select an option from a drop-down list after which the page auto re-loads (the page is using a POST form submit)
  • when the POST variable is filled, it loads the individual nodes that I'm interesting in

My question is whether I can directly access this 2nd page and read the data into a string using php? Normally I would just use file_get_contents() for this, but I don't know how I can add a POST header as additional input to this?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?