[英]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.