简体   繁体   English

使用我自己网站上的外部网页表单获取数据(PHP)

[英]Use an external webpage's form from my own website to get data (PHP)

I wonder if I can use an external form of a webpage in the web from my own website. 我想知道我是否可以在我自己的网站上使用网页的外部形式。 I am creating an application using the WAMP tool and I need some PHP/JavaScript/whatever script to do it. 我正在使用WAMP工具创建一个应用程序,我需要一些PHP / JavaScript /任何脚本来执行它。

Basically I'd have the same exactly form in my website (or at least a similar one) as the one in the external webpage - the goal of this form is only to perform a search. 基本上我在我的网站(或者至少是一个类似的网站)中具有与外部网页中相同的形式 - 此表单的目标只是执行搜索。 The user would be capable of doing the search and seeing the results posted in my website aswell and all this happening in a hidden way. 用户将能够进行搜索并查看我的网站中发布的结果以及所有这些以隐藏的方式发生。

I really have no idea how to do this as I searched stackoverflow and the web looking for a solution but it really seems a little bit complicated. 我真的不知道如何做到这一点,因为我搜索stackoverflow和网络寻找解决方案,但它似乎有点复杂。

Here's an image to ilustrate more or less what I want: 这是一个或多或少地说明我想要的图像:

在此输入图像描述

edit: I don't want any script or code! 编辑:我不想要任何脚本或代码! I Just want to know what is the best way to do this. 我只是想知道最好的方法是什么。 I will eventually come to a solution (I hope!). 我最终会找到一个解决方案(我希望!)。 Thanks! 谢谢!

The concept is called Web Scraping, you can find more about it in https://en.wikipedia.org/wiki/Web_scraping 这个概念叫做Web Scraping,您可以在https://en.wikipedia.org/wiki/Web_scraping中找到更多相关信息。

As an answer, you can write simple web scraper using PHP CURL. 作为答案,您可以使用PHP CURL编写简单的Web scraper。 CURL can submit a remote form for you and get the results of form submit, that results may need to be handled by your script to be displayed in the form you need. CURL可以为您提交远程表单并获取表单提交结果,结果可能需要由您的脚本处理才能以您需要的形式显示。

This stackoverflow question and answer may clear it more for you. 此stackoverflow问题和答案可能会为您更清楚。

How to submit form on an external website and get generated HTML? 如何在外部网站上提交表单并生成HTML?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何用我自己网站上的数据填写另一个网站的表格 - How to fill another website's form with the data in my own website 从外部网址获取信息并将其放在我自己的网站上 - Get information from external url and put it on my own website 如何在Zingchart中使用我自己的外部数据? - How to use my own external data with Zingchart? 加载外部网页并添加自定义标题并使用网页中的数据 - load external webpage and add custom header and use the data from webpage 我可以在浏览器中使用JS从外部网页(跨域)获取某个元素的值吗? - Can I use JS in the browser to get a certain element's value from an external webpage (cross-domain)? 如何使用PHP从我自己的网站上获取Google云端硬盘中的文件和文件夹列表? - How to get list of files and folders from Google Drive on my own website using PHP? 在phonegap中从外部网站获取数据 - Get data from external website in phonegap 从网页中检测我自己的Firefox扩展程序 - Detecting my own Firefox extension from a webpage 使用PHP获取外部网站的cookie - Get cookies of external website with PHP 如何将网页中的一串纯文本插入到我自己网站的 HTML 中? - How to insert a string of plain text from a webpage into my own site's HTML?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM