• Search Bar On Browser_4


    四、 .ini配置文件

    Opera中采用此种方式,在Search.ini文件中定义了支持Opera搜索栏上的搜索引擎。文件格式如下:

    Opera Preferences version 2.0
    ; Do not edit this file while Opera is running
    ; This file is stored in UTF-8 encoding
     
    [Version]
    File Version=8
     
    [Search Engine 1]
    Name=
    URL=http://www.google.com/search?q=%s&sourceid=opera&num=%i&ie=utf-8&oe=utf-8
    Query=
    Key=g
    Is post=0
    Has endseparator=0
    Encoding=utf-8
    Search Type=0
    Verbtext=0
    Position=-1
    Nameid=17171
     
    [Search Engine 2]
    Name=
    URL=http://search.opera.com/?search=%s&global=no
    Query=
    Key=s
    Is post=0
    Has endseparator=0
    Encoding=utf-8
    Search Type=3
    Verbtext=0
    Position=-1
    Nameid=69677
     
    ……
     
    [Search Engine 35]
    Name=XXX
    Verbtext=0
    URL=http://www.XXX.com/product/productlist.aspx?submit=search&description=%s
    Query=
    Key=cv
    Is post=0
    Has endseparator=-1
    Encoding=gbk
    Search Type=0
    Position=-1
    Nameid=0

    一般在Opera中添加搜索不需要在.ini 文件中配置,在浏览器中就可以设置。

    点击菜单Tools->Preferences,打开Preferences面板,点击Search Tabpage,如下图显示Search Engine


    13

    这里可以管理Opera浏览器上的浏览器引擎。包括AddEditDelete

    XXX这个搜索引擎,点击Edit,可以查看XXX这个引擎的具体信息。


    14

    对应到.ini文件中为:

    [Search Engine 35]
    Name=XXX
    Verbtext=0
    URL=http://www.XXX.com/product/productlist.aspx?submit=search&description=%s
    Query=
    Key=cv
    Is post=0
    Has endseparator=-1
    Encoding=gbk
    Search Type=0
    Position=-1
    Nameid=0

    指定了Search EngineNameKeywordAddress,如果使用POST请求,指定的Query String

    URL中,采用%s来指代在搜索栏中输入的关键字。

    15 Opera搜索栏

    当然,Opera帮助中提供了另一种自动添加搜索引擎的方式,非常的方便。

    Adding a new search is most conveniently done as follows:

    1Go to the site that has the search you want.

    2Right-click the search field.

    3Select "Create search" from the context menu.

    4Edit the name of the search engine to your liking.

    5Add a short keyword to be able to use the search engine directly from the address field, as described above.

    6Click "OK", and the new search is added and can be used anywhere within Opera.


    16

    17

    在这里,我们可以发现,Opera为我们创建的搜索引擎,输入Keyword后,点击OK就可以添加。使用了POST请求。

    Address=http://www.XXX.com/index.aspx
    QueryString=__EVENTTARGET=&__EVENTARGUMENT=&CVState2008=%2FwEPDwUJNzU0MDM3NDM3ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WBgUiSXRlbVN1bW1hcnlDb250cm9sOkJ1dHRvbkFkZFRvQ2FydAUiSXRlbVN1bW1hcnlDb250cm9sOkJ1dHRvbkFkZFRvQ2FydAUiSXRlbVN1bW1hcnlDb250cm9sOkJ1dHRvbkFkZFRvQ2FydAUiSXRlbVN1bW1hcnlDb250cm9sOkJ1dHRvbkFkZFRvQ2FydAUiSXRlbVN1bW1hcnlDb250cm9sOkJ1dHRvbkFkZFRvQ2FydAUiSXRlbVN1bW1hcnlDb250cm9sOkJ1dHRvbkFkZFRvQ2FydA%3D%3D&description=%s&Search%3AStoreList=&txtSubEmail=Enter+Email+Address&qty=1&qty=1&qty=1&qty=1&qty=1&qty=1&x=0&y=0

    OscarXie.net

    关注质量与体验——电子商务与自动化测试
    http://www.cnblogs.com/oscarxie/

  • 相关阅读:
    Json
    JQuery的validate不起作用的情况
    ajax的同步异步
    Bootstrap--switch
    Bootstrap--multiselect
    ArcGIS地图打印那些事
    openlayers调用瓦片地图分析
    多种在线地图综合对比,Google,必应,arcgis Online...
    map的infowindow的show事件(ArcGIS API for JS)
    在ArcGIS中导出现有mxd的style文件
  • 原文地址:https://www.cnblogs.com/oscarxie/p/588814.html
Copyright © 2020-2023  润新知