简体   繁体   English

如何根据用户输入从Google图片中提取图片并将其放置在页面上?

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

相关问题 轮播图像正在堆叠,如何阻止它们堆叠? - Carousel images are stacking, how do I stop them from stacking? 如何将从数据库中随机选择的图像放置在页面上的随机位置? - How to place randomly selected images from a database at random locations on a page? 如何为用户上传的图片提供服务? - How do I serve user uploaded images? 如果用户点击谷歌图片中的图片(来自搜索),我可以强制重定向到该页面吗? - If a user clicks on an image in google images(from a search) can I force a redirect to the page? 图像并排放置,如何垂直列出图像? - Images are placed side by side, how do I list them vertically? 如何使用 Flickr API 从某个地方返回图像 - How Can I Use Flickr API to return images from a place 如何将多张图片的完整路径存储到数据库中,以便可以在用户首页(例如Orkut)中显示它们 - How to store multile images full path into a database so that I can display them in a user home page like Orkut 如何扫描图像目录并使用php将其放置在我的画廊中 - How can I scan a directory of images and place them in my gallery with php 从 PDF 页面部分提取图像 - Extract images from PDF page section 如何从 PHP 表单将图像上传到 Google Cloud Storage? - How do I upload images to the Google Cloud Storage from PHP form?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM