自定义Google搜索(不是Google自定义搜索)

时间:2019-02-23 21:56:04

标签: html forms search

有人可以向我解释一下此HTML的工作原理,因为我真的想做一些搜索此HTML的内容: https://www.google.com/search?q=%25s&client=firefox-b-1-d&biw=1366&bih=614&tbm=isch&source=lnt&tbs=isz:ex,iszw:7680,iszh:4320

<div><form action="https://www.google.com/search" method="get" name="{5C088896-C4CC-4430-A6D8-9DC9D2BE379D}" target="_top"><input maxlength="255" name="q" size="35" type="text"><input name="Overview" type="hidden" value="1"><input name="internettips" type="submit" value="Find Flash Files"><input name="as_filetype" type="hidden" value="swf"></form></div>

如果您可以帮助我先谢谢您,我就使用了检查元素从InternetTIPS.com获取了HTML

(同样,如果您想演示HTML的功能here you go

1 个答案:

答案 0 :(得分:0)

这是向页面中添加搜索表单的唯一HTML,该页面可搜索Google特定尺寸的图像:

<!-- This is a search form that will take us to
     https://www.google.com/search?tbm=isch&tbs=isz:ex,iszw:7680,iszh:4320&q=example
     when we search for example. This search will show us only images, and
     those images will all be 7680 pixels wide and 4320 pixels tall.

     First we enclose everything in a <> whose  is everything that
     the search engine results page’s URI to the left of the question mark (?)
     in it -->
<form action="https://www.google.com/search" method="get">

   <!-- Next, we add the arguments that are added to the Google URI. For each
        part of the URI we want to build, we need an <> element with a
         attribute. -->

   <!-- build tbm=isch -->
   <!-- tbm needs to be set to isch, which tells Google we want only
        image search results. We add ="" to the input element
        because we don’t want the end user to have to choose that
        themself -->
   <input name="tbm" value="isch" type="hidden">

   <!-- build tbs=isz:ex,iszw:7680,iszh:4320 -->
   <!-- tbs needs to be set to a three-part parameter that tell’s Google
        we’re doing a search for images of a certain size and what the
        dimensions we’re looking for are -->
   <input name="tbs" value="isz:ex,iszw:7680,iszh:4320" type="hidden">

   <!-- build q=example (but ours won’t specify "example" — the user
        will decide what to search for). This parameter’s  is
        not  but rather , which is what we’ll ask the user to
        enter. -->
   <!-- If we don’t want to prompt our users’ imaginations,
        we could remove placeholder="puppies" -->
   <!-- size="35" means that the field where the user will input their
        query is about 35 characters wide on page load -->
   <input name="q" size="35" type="text" placeholder="puppies">

   <!-- Finally, we add the button the user can tap to enter their query,
        so our  is . We can set our value to whatever we want
        our button to say -->
   <input type="submit" value="Find images of size 7680px × 4320px">

 <!-- <> is the only element we have used that we must close -->
 </form>