Summary of the invention
The application provides searching method and the device in a kind of browser, when searching for again to solve the manual switchover search engine, and very loaded down with trivial details of operation, the problem of waste user's time.
In order to address the above problem, the application discloses the searching method in a kind of browser, comprising:
Judge the service fault of first search engine, then obtain search key to first search engine;
Generate search link to second search engine of said search key;
Search link according to said generation generates the Search Results to said search key.
Preferably, the said step of obtaining to the search key of first search engine comprises:
From the search input frame on browser menu hurdle, obtain the search key of input; Or
Obtain the search key of input in the search input frame from search and webpage.
Preferably, the said step of obtaining to the search key of first search engine comprises:
Obtain the search link of first search engine that is used to search for said search key;
From the search link of said first search engine, obtain search key.
Preferably, described method further comprises:
Obtain the search link of said first search engine in advance;
Analyze the structure and the coded system of the search link of said first search engine;
According to the structure of said search link, obtain the position at key word place in the search link of said first search engine.
Preferably, described method further comprises:
Obtain the search link of said second search engine in advance;
Analyze the structure and the coded system of the search link of said second search engine;
According to the structure of said search link, obtain the position at the key word place in the search link of said second search engine.
Preferably, obtain search key said search from said first search engine links, comprising:
The position at key word place obtains first key word sign from the search link of said first search engine;
According to the coded system in the search link of said first search engine, said first key word sign is decoded to obtain said search key.
Preferably, the said position that key word belongs to from the search link of said first search engine obtains first key word sign, comprising:
Use said first regular expression, from the search of first search engine link, search the position at said key word place, wherein, said first regular expression is used for searching the position at the search link key word place of first search engine;
Obtain said first key word sign in the position at said key word place.
Preferably, said generation comprises to the step of the search link of second search engine of said search key:
Take the coded system in the search link of said second search engine, the key word of said search is encoded, obtain corresponding second key word sign;
Said second key word sign is added in the position at key word place in the search of second search engine link, generates the search link of second search engine that is used to search for said search key.
Preferably, the position that key word belonged to during said search at second search engine linked is added the said second key word identification of steps and is comprised:
Use said second regular expression, in the search of second search engine link, search the position at said key word place, wherein, said second regular expression is used for searching the position at the search link key word place of first search engine;
Add said second key word sign in the position at said key word place.
Preferably, described method also comprises:
Obtain the position at search terms place in the search link of said first search engine;
Obtain the position at search terms place in the search link of said second search engine;
Wherein, said search terms comprises literal, audio frequency, video, picture, map.
Preferably, described method also comprises:
The position at search terms place obtains user's search terms from the search link of said first search engine.
Preferably, before the search link that generates second search engine that is directed against said search key, also comprise:
From the search of said second search engine link, the search terms corresponding search of choosing with the user links.
Preferably, described method also comprises:
Select second search engine and preservation in advance.
Preferably, the service fault step of said judgement first search engine comprises:
If first search engine with regard to searching request feedback one prompting error message, is judged the service fault of first search engine.
Accordingly, disclosed herein as well is the searcher in a kind of browser, comprising:
Obtain keyword module, be used to judge the service fault of first search engine, then obtain search key to first search engine;
Generate link module, be used to generate search link to second search engine of said search key;
Generate object module, be used for search link, generate Search Results said search key according to said generation.
Preferably, the said keyword module of obtaining comprises:
First obtains the key word submodule, is used for obtaining from the search input frame on browser menu hurdle the search key of input; Or, obtain the search key of input in the search input frame from search and webpage.
Preferably, the said keyword module of obtaining comprises:
Obtain the link submodule, be used to obtain the search link of first search engine that is used to search for said search key;
Second obtains the key word submodule, is used for obtaining search key from the search link of said first search engine.
Preferably, described device also comprises: first pre-processing module comprises:
First obtains submodule, is used for obtaining in advance the search link of said first search engine;
Analyze submodule, be used to analyze the structure and the coded system of the search link of said first search engine;
Second obtains submodule, is used for the structure according to said search link, obtains the position at key word place in the search link of said first search engine.
Preferably, described device also comprises: second pre-processing module comprises:
First obtains submodule, is used for obtaining in advance the search link of said second search engine;
Analyze submodule, be used to analyze the structure and the coded system of the search link of said second search engine;
Second obtains submodule, is used for the structure according to said search link, obtains the position at the search key place in the search link of said second search engine.
Preferably, said second obtains the key word submodule, comprising:
Acquiring unit is used for obtaining first key word sign from the position that the search link key word of said first search engine belongs to;
Decoding unit is used for the coded system according to the search link of said first search engine, and said first key word sign is decoded to obtain said search key.
Preferably, said generation link module comprises:
The coding submodule is used for taking the coded system of the search link of said second search engine, and said search key is encoded, and obtains corresponding second key word sign;
Add submodule, be used for adding said second key word sign, generate the search link of second search engine that is used to search for said search key in the position at the key word place of the search link of second search engine.
Preferably, said first pre-processing module also comprises:
The 3rd obtains submodule, is used for obtaining the position at the search link search terms place of said first search engine;
Said second pre-processing module also comprises:
The 3rd obtains submodule, is used for obtaining the position at the search link search terms place of said first search engine;
Wherein, said search terms comprises literal, audio frequency, video, picture, map.
Preferably, described device also comprises:
Obtain the search terms module, be used for obtaining user's search terms from the position that the search link search terms of said first search engine belongs to.
Preferably, said generation link module also comprises:
Choose submodule, be used for from the search of said second search engine link, the search of choosing with user's search terms links.
Preferably, described device also comprises:
Preserve module, be used for selecting in advance second search engine and preservation.
The preferred said keyword module of obtaining comprises:
The fault judgement module if be used for first search engine with regard to searching request feedback one prompting error message, is judged the service fault of first search engine.
Compared with prior art, the application comprises following advantage:
In sum; Judge the service fault of first search engine, then obtain search key, generate search link to second search engine of said search key to first search engine; Search link according to said generation generates the Search Results to said search key.The application is when the first search engine service fault of the current use of user, and the search engine that can automatically switch shows search data to the user.Simple to operate, need not manually to re-enter key word and manual switchover search engine, can obtain search data fast, save time.
Secondly, key word can be directly obtained in application from search box, and the structure of page link that also can be through analyzing search engine is obtained key word, and the acquisition methods of key word is various, can satisfy the needs that various search engines switch.
Once more; The application not only can obtain key word from the search link of search engine, can also obtain user's search terms, therefore when the page link of follow-up coupling second search engine; The search that can choose with user's search terms links, then match keywords.Reduce the user also will choose search terms when searching for again troublesome operation process.
Embodiment
For above-mentioned purpose, the feature and advantage that make the application can be more obviously understandable, the application is done further detailed explanation below in conjunction with accompanying drawing and embodiment.
With reference to Fig. 1, provided the searching method process flow diagram in the said a kind of browser of the application embodiment.
Step 11 is judged the service fault of first search engine, then obtains the search key to first search engine;
The user selects first search engine to search for, and behind the search key of inputted search, can click the search link that search can generate one first search engine this moment, and promptly URL (URL) wherein comprises search key.
Search link through said first search engine could be obtained search data, but if said first search engine breaks off with browser for some reason to be connected, just can't obtain search data, for example, " bad luck may occur during user search sometimes! The XX search is like out of joint ... " explain that search engine can not connect when user search.
At this moment, browser can obtain the search key to first search engine.
Step 12 generates the search link to second search engine of said search key;
Behind the above-mentioned key word that gets access to user search, can be according to the structure of the search link of second search engine, match the search link of second search engine that is used to search for said search key, i.e. URL.Be to comprise search key among the said URL, use said URL can obtain said search key corresponding search data.
Step 13, the search link according to said generation generates the Search Results to said search key.
After the search link of above-mentioned generation to second search engine of said search key; Can use the search chain of said second search engine to connect second search engine in succession; The corresponding webpage of said search link can be got access to then, said search key corresponding search result can be therefrom obtained.
In sum; Judge the service fault of first search engine, then obtain search key, generate search link to second search engine of said search key to first search engine; Search link according to said generation generates the Search Results to said search key.The application is when the first search engine service fault of the current use of user, and the search engine that can automatically switch shows search data to the user.Simple to operate, need not manually to re-enter key word and manual switchover search engine, can obtain search data fast, save time.
Preferably, the said method of obtaining the key word of user search comprises:
1, from the search input frame, obtains the key word of user search.
Specifically comprise:
From the search input frame on browser menu hurdle, obtain the search key of input; Or
Obtain the search key of input in the search input frame from search and webpage.
In the practical implementation, the user can directly keep the key word in the search input frame after clicking search, and the key word that perhaps will search in the input frame is stored in the historical record, and the application does not do qualification for the storage means of key word in the search input frame.
Search data in the search input frame is obtained at the switching search engine and can directly be obtained the key word of user search after obtaining.
2, obtain the search link of first search engine that is used to search for said search key; From the search link of said first search engine, obtain search key.
After the user is selected in first search engine; Meeting input key word is clicked then and is searched for; Can produce the search link of first search engine that is used to search for said search key this moment; Browser can be caught said search link, obtains search key in the search link of said then first search engine.
In sum, application can directly be obtained key word from the search input frame, and the structure that also can link through the search of analyzing search engine is obtained key word, and the acquisition methods of key word is various, can satisfy the needs that various search engines switch.
Following mask body is discussed the analytical approach of the search link of search engine.
With reference to Fig. 2, provided preprocess method process flow diagram in the searching method in the said a kind of browser of the application's preferred embodiment.
Step 201, the search link of obtaining at least two search engines in advance;
Comprise: obtain the search link of said first search engine in advance, and, the search link of obtaining said second search engine in advance.
A plurality of different search engines are arranged in the actual treatment, for example, Google (google), Baidu, search dog and have etc.The search link of each search engine all has its particular structure; Therefore can obtain the search link that wherein connects a search engine at least in advance; Like first search engine and second search engine,, can switch to second search engine so that follow-up when a search engine can not connect.
For example, to same keyword X:
When using Google to search for, the search of Google is linked as:
http://www.google.com.hk/#hl=en&newwindow=1&safe=strict&site=&sour?ce=hp&q=%E5%A5%87%E8%99%8E&oq=%E5%A5%87%E8%99%8E&aq=f&aqi=&aql=&gs_sm=3&gs_upl=7556l8359l0l8619l5l5l0l0l0l0l0l0ll0l0&gs_l=hp.3...7556l8359l0l8619l5l5l0l0l0l0l0l0ll0l0.frgbld.&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=15c06062bf1af023&biw=1366&bih=602
When using Baidu to search for, the search of Baidu is linked as:
http://www.baidu.com/s?wd=%E5%A5%87%E8%99%8E&rsv_spt=1&issp=1&rsv_bp=0&ie=utf-8&tn=baiduhome_pg&inputT=1529
Step 202 is analyzed the structure and the coded system of the search link of said search engine;
Comprise: analyze the structure and the coded system of the search link of said first search engine, and, analyze the structure and the coded system of the search link of said second search engine.
Then the structure of the search of the above-mentioned search engine that obtains link is analyzed; For example; The network address that can comprise the homepage of this search engine in the search of the search engine link, key word sign that key word is corresponding (like, the sign of X in said URL) and user's search terms is (for example; The user wants search and webpage, or the search map).
Can also analyze the coded system in the search link of said search engine, promptly how convert the key word of user search to the key word sign.
Step 203 according to the structure of said search link, is obtained the position at the key word place in the search link of said search engine;
Comprise: obtain the position at the search key place in the search link of said first search engine, and, obtain the position at the search key place in the search link of said search engine.
The structure of above-mentioned search link to the search engine that obtains is analyzed, and can therefrom get access to the position at the key word place of user search then.
In the practical implementation, can generate a regular expression or search function, when needs switch search engine, can use said regular expression and the said function of searching, from the search link, find search key.
For example, define following data structure and mate the URL that captures:
Step 204 is obtained the position at search terms place in the search link of said search engine, and wherein, said search terms comprises literal, audio frequency, video, picture, map;
Comprise: obtain the position at search terms place in the search link of said first search engine, and, obtain the position at search terms place in the search link of said first search engine.
The application be except can obtaining the key word of user search from the search of search engine link, can also (that is, structure URL) is obtained the position at user's search terms place through analyzing said search link.
Wherein, said search terms comprises literal, audio frequency, video, picture, map, can be the option of user search, as, behind the user entered keyword, can select search and webpage, map, audio frequency, video and picture etc.
In the practical implementation, can generate a regular expression or search function, when needs switch search engine, can use said regular expression and the said function of searching, from the search link, find search terms.
Step 205 is selected second search engine and preservation in advance;
In the reality, comprise multiple search engine, therefore can pre-set second search engine and preservation, make the user when using the disconnection of first search engine and browser to be connected, can automatically switch to second search engine and search for.
In the practical implementation; For example; The user can provide a few money search engines to supply users to select in the time once can't connecting first search engine, and the search engine of then can the default setting user selecting is second search engine; Just can switch automatically when same situation occurring later on, reduce user's operation.Certainly, when switching second search engine, can remind user browser to lose with first search engine is connected.Above-mentioned only is a kind of method in the practical implementation, and the application does not do qualification to this.
After the above-mentioned structure that analyzes each search engine; Can be informed in the position at key word place in the page link of each search engine; Can generate corresponding regular expression then, said regular expression can be used for searching the position at the search link key word place of search engine.
Preferably, described method also comprises:
Generate first regular expression, said first regular expression is used for searching the position at the search link key word place of first search engine.
Generate second regular expression, said second regular expression is used for searching the position at the search link key word place of first search engine.
Certainly, regular expression can also be generated, the search link search terms position of search engine can be used for searching to said search terms.
With reference to Fig. 3, provided the process flow figure that is directed against URL in the searching method in the said a kind of browser of the application's preferred embodiment.
Step 301, the position at key word place obtains first key word sign from the search link of said first search engine;
For example, the user adopts first search engine defeated, imports ABC in the search box, and the search terms of selection is a map, and promptly the user will search for the position of ABC in map.
After clicking search, browser loses with first search engine and is connected for some reason, can't obtain the position of ABC in map.
At this moment, browser can be caught the search link of first search engine that is used to search for described key word.Then according between to the result of the structure analysis of the search of first search engine link, can from the search link of said first search engine, obtain first key word sign in the position at key word place.
For example, defining the method for obtaining key word among the URL is:
Preferably, the said position that key word belongs to from the search link of said first search engine obtains first key word sign, comprising:
Use said first regular expression, from the search link of first search engine, search the position at said key word place;
Obtain said first key word sign in the position at said key word place.
Step 302 according to the coded system in the search link of said first search engine, is decoded to obtain said search key to said first key word sign.
Coded system during the above-mentioned search that has analyzed first search engine equally links; Just can use the corresponding decoding process of said coded system; Said first key word sign is decoded; Can obtain said search key then, for example, the search key that the sign of first key word described in the last example decodes should be ABC.
Step 303, the position at search terms place obtains user's search terms from the search link of said first search engine;
The above-mentioned structure that the search of first search engine is linked is analyzed, and has analyzed the position at search terms place in the search link of said first search engine, can from the search link of said first search engine, obtain user's search terms then.For example, user's search terms is a map in the last example.
Can use the regular expression that generates in advance or search the position that function is searched search terms place in the search link of first search engine.
Step 304, from the search of said second search engine link, the search of choosing with user's search terms links;
Structure through the search to search engine links is analyzed, and can obtain out the search terms in the said search link.Therefore, can store the search link of various search termses in advance, for example the URL1.1 correspondence adopts search engine 1 search and webpage, corresponding search engine 1 search video that adopts of URL1.2, the corresponding employing of URL1.3 search engine 1 search map etc.
Therefore, can be from the search of second search engine link, the search that can choose with user's search terms link, for example, chooses URL2.3, and the corresponding search engine 2 that adopts is searched for maps.
Step 305 is taked the coded system in the search link of said second search engine, and said search key is encoded, and obtains corresponding second key word sign;
In second search engine, choose URL2.3 as above-mentioned; Promptly adopt search engine 2 search maps; Then according to the coded system in the search link of second search engine that obtains in advance; Take said coded system, (like ABC) encodes to said search key, obtains corresponding second key word sign.
Step 306, said second key word sign is added in the position at key word place in the search of second search engine link, generates the search link of second search engine that is used to search for said search key.
Above-mentioned getting access in second search engine; After second key word that search key (like ABC) is corresponding identifies; Can at first in the search link of second search engine, search the position at said key word place, add said second key word sign in the position at said key word place then.
As, said second key word sign is added in the position at said key word place then in the position at search key place in URL2.3, generates the search link of second search engine that is used to search for said key word ABC.
Preferably, the position that key word belonged to during said search at second search engine linked is added the said second key word identification of steps and is comprised:
Use said second regular expression, in the search link of second search engine, search the position at said key word place;
Add said second key word sign in the position at said key word place.
In sum; The application not only can obtain key word from the search link of search engine, can also obtain user's search terms, therefore when the search link of follow-up coupling second search engine; Can choose with the corresponding search of user's search terms and link, then match keywords.Reduce the user also will choose search terms when searching for again troublesome operation process.
Preferably, the service fault step of said judgement first search engine comprises:
If first search engine with regard to searching request feedback one prompting error message, is judged the service fault of first search engine.
The service fault of first search engine can be connected for browser breaks off with said first search engine among the application, can certainly be that first search engine has fed back the prompting error message with regard to searching request.
With reference to Fig. 4, provided the searcher structural drawing in the said a kind of browser of the application embodiment.
Accordingly, the application also provides the switching device shifter of search engine in a kind of browser, comprising: obtain keyword module 14, generate link module 16 and generate object module 17, wherein:
Obtain keyword module 14, be used to judge the service fault of first search engine, then obtain search key to first search engine;
Generate link module 16, be used to generate search link to second search engine of said search key;
Generate object module 17, be used for search link, generate Search Results said search key according to said generation.
Preferably, the said keyword module 14 of obtaining comprises:
First obtains key word submodule 141, is used for obtaining from the search input frame on browser menu hurdle the search key of input; Or, obtain the search key of input in the search input frame from search and webpage.
Obtain link submodule 142, be used to obtain the search link of first search engine that is used to search for said search key;
Second obtains key word submodule 143, is used for obtaining search key from the search link of said first search engine.
Preferably, second obtains key word submodule 143, comprising:
Acquiring unit 1431 is used for obtaining first key word sign from the position that the search link key word of said first search engine belongs to;
Decoding unit 1432 is used for the coded system according to the search link of said first search engine, and said first key word sign is decoded to obtain said search key.
Preferably; Said acquiring unit 1431 is used to use said first regular expression, from the search link of first search engine, searches the position at said key word place; Wherein, said first regular expression is used for searching the position at the search link key word place of first search engine; Obtain said first key word sign in the position at said key word place.
Preferably, described device also comprises: first pre-processing module 11 comprises:
First obtains submodule 111, is used for obtaining in advance the search link of said first search engine;
Analyze submodule 112, be used to analyze the structure and the coded system of the search link of said first search engine;
Second obtains submodule 113, is used for the structure according to said search link, obtains the position at key word place in the search link of said first search engine.
The 3rd obtains submodule 114, is used for obtaining the position at the search link search terms place of said search engine, and wherein, said search terms comprises literal, audio frequency, video, picture, map.
Second pre-processing module 12 comprises:
First obtains submodule 121, is used for obtaining in advance the search link of said second search engine;
Analyze submodule 122, be used to analyze the structure and the coded system of the search link of said second search engine;
Second obtains submodule 123, is used for the structure according to said search link, obtains the position at the search key place in the search link of said second search engine;
The 3rd obtains submodule 124, is used for obtaining the position at the search link search terms place of said first search engine.
Wherein, said search terms comprises literal, audio frequency, video, picture, map.
Preferably, said generation link module 16 comprises:
Choose submodule 161, be used for from the search of said second search engine link, the search of choosing with user's search terms links.
Coding submodule 162 is used for taking the coded system of the search link of said second search engine, and said search key is encoded, and obtains corresponding second key word sign;
Add submodule 163, be used for adding said second key word sign, generate the search link of second search engine that is used to search for said search key in the position at the key word place of the search link of second search engine.
Said interpolation submodule 163; Also be used to use said second regular expression; In the search of second search engine link, search the position at said key word place, wherein, said second regular expression is used for searching the position at the search link key word place of first search engine; Add said second key word sign in the position at said key word place.
Preferably, described device also comprises:
Obtain search terms module 15, be used for obtaining user's search terms from the position that the search link search terms of said first search engine belongs to.
Preserve module 13, be used for selecting in advance second search engine and preservation.
The said keyword module 14 of obtaining comprises:
Fault judgement module 140 if be used for first search engine with regard to searching request feedback one prompting error message, is judged the service fault of first search engine
For device embodiment, because it is similar basically with method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.
The application can describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract, program, object, assembly, data structure or the like.Also can in DCE, put into practice the application, in these DCEs, by through communication network connected teleprocessing equipment execute the task.In DCE, program module can be arranged in this locality and the remote computer storage medium that comprises memory device.
At last; Also need to prove; In this article; Relational terms such as first and second grades only is used for an entity or operation are made a distinction with another entity or operation, and not necessarily requires or hint relation or the order that has any this reality between these entities or the operation.And; Term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability; Thereby make and comprise that process, method, commodity or the equipment of a series of key elements not only comprise those key elements; But also comprise other key elements of clearly not listing, or also be included as this process, method, commodity or equipment intrinsic key element.Under the situation that do not having much more more restrictions, the key element that limits by statement " comprising ... ", and be not precluded within process, method, commodity or the equipment that comprises said key element and also have other identical element.
More than to searching method and device in a kind of browser that the application provided; Carried out detailed introduction; Used concrete example among this paper the application's principle and embodiment are set forth, the explanation of above embodiment just is used to help to understand the application's method and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to the application's thought, the part that on embodiment and range of application, all can change, in sum, this description should not be construed as the restriction to the application.