如何从php中的其他网站获取数据 [英] How to get data from the other website in php

查看:113
本文介绍了如何从php中的其他网站获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iframe在我的网页中显示其他网页的其他网页用户提供他的数据并在其他网页上提交,之后它(其他网页)会给出一些结果,如何从其他网页获取数据,我正在使用PHP。请帮助......

I am using iframe to display other's webpage in my webpage in that other's page user give's his data and submit it on other's webpage, after that it(other's page) gives some result, How can i get the data from the other's page, i am using PHP. please help...

推荐答案

这叫做网页抓取 http://en.wikipedia.org/wiki/Web_scraping [ ^ ]。



例如,请参阅此基本教程:http://www.oooff.com/php-scripts/basic-php-scrape-tutorial/basic-php-scraping。 php [ ^ ]。



它基于发送HTTP请求,获取HTTP响应中返回的内容并可能解析它。对于更高级的请求,您可以提交表单,进行身份验证等,请参阅:

http://www.php.net/manual/en/function.http-request.php [ ^ ],

http://php.net/manual/en/function.http-post-data.php [ ^ ]。



请参见左侧树中HTTP方法下的其他方法。



-SA
This is called Web scraping: http://en.wikipedia.org/wiki/Web_scraping[^].

See, for example, this basic tutorial: http://www.oooff.com/php-scripts/basic-php-scrape-tutorial/basic-php-scraping.php[^].

It's based on sending a HTTP request, getting content returned in HTTP response and perhaps parsing it. For more advanced requests, so you could, for example, submit a form, authenticate, etc., please see:
http://www.php.net/manual/en/function.http-request.php[^],
http://php.net/manual/en/function.http-post-data.php[^].

See other methods in the tree on left, under "HTTP methods".

—SA


这篇关于如何从php中的其他网站获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆