[英]How do I extract images from Google Images based on user input and place them on a page?
I'm new to web programming, but I had an idea I could use as an instructional tool, and I was hoping I could get some guidance. 我是Web编程的新手,但是我有一个想法可以用作教学工具,我希望可以得到一些指导。
Here's my idea: I want to have some form that takes the data entered by the user, submits each word in the form to google images, and retrieves the first image returned by Google Image Search. 这是我的主意:我想使用某种形式来接收用户输入的数据,将表单中的每个单词提交给Google图片,然后检索Google图片搜索返回的第一张图片。 Each image should be then be pasted in the current document 然后应将每个图像粘贴到当前文档中
What language would I need for this (I read about it being disallowed in Javascript due to cross-site scripting?), what kind of topics would I need to learn, and what would the basic template look like for doing such a task? 我需要哪种语言(由于跨站点脚本编写,我在Javascript中不允许使用它?),我需要学习哪种主题,以及执行此任务所需的基本模板是什么样的?
Thanks. 谢谢。
personally i would have a PHP interface with a python script that does the work. 就个人而言,我会有一个带有Python脚本的PHP接口来完成这项工作。 Have a look at urllib in python. 看看python中的urllib。 You could also try cURL within PHP and just construct the url yourself. 您也可以尝试在PHP中使用cURL并自己构造URL。 If memory serves however google like you to actually be on their website to see their adverts. 如果记忆服务不过Google像您一样实际在他们的网站上看到他们的广告。 Pretty sure they block requests that appear like they come from scripts / webhosts. 可以肯定的是,它们会阻止来自脚本/网络主机的请求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.