CN107577592A - The localization method and device of web page element - Google Patents

The localization method and device of web page element Download PDF

Info

Publication number
CN107577592A
CN107577592A CN201610520639.1A CN201610520639A CN107577592A CN 107577592 A CN107577592 A CN 107577592A CN 201610520639 A CN201610520639 A CN 201610520639A CN 107577592 A CN107577592 A CN 107577592A
Authority
CN
China
Prior art keywords
web page
page element
finger url
keyword
positioning
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610520639.1A
Other languages
Chinese (zh)
Other versions
CN107577592B (en
Inventor
俞樟欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201610520639.1A priority Critical patent/CN107577592B/en
Publication of CN107577592A publication Critical patent/CN107577592A/en
Application granted granted Critical
Publication of CN107577592B publication Critical patent/CN107577592B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of localization method of web page element and device, method includes:The character string for including positioning keyword of input is received, positioning keyword derives from the word shown in webpage;Judge position finger URL whether is included in character string, position finger URL is used for the relative position for indicating positioning keyword and web page element to be positioned;If not including position finger URL in character string, the web page element with positioning keyword match in webpage is traveled through;If including position finger URL in character string, the web page element consistent with the relative position and the instruction of position finger URL for positioning keyword is searched.According to the localization method and device of web page element provided by the invention, so that when being positioned to web page element, the positioning to web page element can be realized directly according to the information such as keyword, position finger URL are positioned in webpage, the limitation that code could be positioned must be read by breaking away from, easy easily to perform.

Description

The localization method and device of web page element
Technical field
The present invention relates to computer software fields, and in particular to the localization method and device of a kind of web page element.
Background technology
Webpage is in test, it is necessary to test each element in webpage.Firstly the need of element is found, it is carried out Positioning, to be accurately obtained the information of the element.Element can be tested afterwards, such as to element set display content, Clicking operation etc. is carried out to element.
Prior art uses such as WebDriver automated test tools, it is possible to achieve the positioning to element in webpage.But The automated test tools such as WebDriver to element when positioning, it is necessary to know id, name of the information such as element of element Deng.These information users must be by checking webpage the code such as html, js, the definition to element in webpage is found, from code In obtain the information such as the id of element.For a user, it is desirable to have to be understood that the language such as html, js, this allow for test job by Limit, can not be popularized.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome above mentioned problem or at least in part solve on State the localization method and device of the web page element of problem.
According to an aspect of the invention, there is provided a kind of localization method of web page element, it includes:
The character string for including positioning keyword of input is received, positioning keyword derives from the word shown in webpage;
Judge position finger URL whether is included in character string, position finger URL is used to indicate positioning keyword and net to be positioned The relative position of page element;
If not including position finger URL in character string, the web page element with positioning keyword match in webpage is traveled through;
If including position finger URL in character string, search and indicated with the relative position of positioning keyword and position finger URL Consistent web page element.
According to another aspect of the present invention, there is provided a kind of positioner of web page element, it includes:
Receiving module, suitable for receiving the character string for including positioning keyword of input, positioning keyword is derived from webpage The word of display;
Finger URL judge module, suitable for judging position finger URL whether is included in character string, position finger URL is used to indicate Position the relative position of keyword and web page element to be positioned;
Element spider module, if suitable for not including position finger URL in character string, travel through in webpage with positioning keyword The web page element of matching;
Finger URL searching modul, if suitable for including position finger URL in character string, search relative with positioning keyword Position and position finger URL indicate consistent web page element.
According to the localization method and device of web page element provided by the invention, receive input includes the word for positioning keyword Symbol string, the web page element with positioning keyword match can be positioned by way of traversal.Further determine when further specify position During the symbol of position, the web page element consistent with the relative position and the instruction of position finger URL for positioning keyword is searched, can be accurate Locating web-pages element.So that when positioning web page element, without codes such as html, the js checked in webpage, go to find webpage To the definition of element in code.The multi-aspect informations such as word that can be directly from web displaying, position relationship, realize to webpage member The positioning of element, the limitation that code could be positioned must be read by breaking away from, easy easily to perform.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this area Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows the flow chart of the localization method of web page element according to an embodiment of the invention;
Fig. 2 shows the schematic diagram of a log-on webpage;
Fig. 3 shows the schematic diagram of a user profile typing webpage;
Fig. 4 shows the flow chart of the localization method of web page element in accordance with another embodiment of the present invention;
Fig. 5 shows the functional block diagram of the positioner of web page element according to an embodiment of the invention;
Fig. 6 shows the functional block diagram of the positioner of web page element in accordance with another embodiment of the present invention.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
, it is necessary to test each element in webpage when webpage is tested, such as input frame element, it is necessary to test correctly aobvious Show word, length limitation etc. is carried out to display word;Function is chosen or cancelled to multiselect frame or radio box element, it is necessary to test;Chain Element is connect, it is necessary to test link clicks function;Button element is, it is necessary to click function of testing button etc..Different elements are all Need to test different function realizations.
Fig. 1 shows the flow chart of the localization method of web page element according to an embodiment of the invention.As shown in figure 1, The localization method of web page element specifically comprises the following steps:
Step S101, receive the character string for including positioning keyword of input.
Webpage includes many elements, has the input frame element for input, button element, provides the member that link redirects Element, also choice box element, word for prompt message etc..Log-on webpage as shown in Figure 2, show in webpage such as with Name in an account book, password, remember the prompt message word such as user name, there is its corresponding input frame element, radio box member by these words Element, further comprises in webpage such as log in, cancel button element, linking element returns to upper page.Positioning keyword derives from webpage The word of middle display, can be the word for prompt message, such as user name, password;It can also be the text in linking element Word, such as return to upper page;The word that button element is shown is can also be, is such as cancelled.Further, it can be in webpage to position keyword A part for the word of display, such as return.
Determine to position keyword according to web page element to be positioned, position keyword and web page element phase to be positioned Close.When such as web page element to be positioned is the input frame of password, positioning keyword can be arranged to password or close.It is such as to be positioned Web page element when being login button, positioning keyword can be arranged to log in.If web page element to be positioned is link member When plain, positioning keyword can be arranged to return to upper page or return.
Step S102, judge whether include position finger URL in character string.
In character string in addition to comprising positioning keyword, position finger URL can also be included.Position finger URL is used to indicate to determine The relative position of position keyword and web page element to be positioned.Log-on webpage as shown in Figure 2, when web page element to be positioned is password Input frame when, for positioning keyword when being arranged to password, position finger URL is the relative position of the input frame of cipher text and password Put, for Password Input frame on the right side of cipher text, position finger URL is right side;When positioning keyword is arranged to remember user name, Position finger URL is the relative position for the input frame for remembeing user name word and password, and Password Input frame is remembeing user name word Upside, position finger URL is upside.When web page element to be positioned is login button, when positioning keyword is arranged to log in, Word and login button are logged in same place, therefore need not set location finger URL again;When positioning keyword is arranged to cancel, Login button is cancelling the left side of word, and position finger URL is left side.
Judge whether include position finger URL in character string, if comprising, step S104 is performed, otherwise, execution step S103.
Step S103, travel through the web page element with positioning keyword match in webpage.
The web page element in webpage is traveled through, searches the web page element to match with positioning keyword.It is such as crucial by positioning When word login carrys out locating web-pages element login button, the object of log-on webpage is generated for the network address of log-on webpage, in webpage pair As the element in middle traversal webpage, search with logging in the web page element matched.
Step S104, search the web page element consistent with the relative position and the instruction of position finger URL for positioning keyword.
Required to look up when containing position finger URL in character string, during lookup and the relative position of positioning keyword and position Put finger URL and indicate consistent web page element.The position of positioning keyword can be found by Search and Orientation keyword, enters one Step, search the web page element of the side indicated by the position finger URL positioned at positioning keyword.If element to be positioned is user name During input frame, the position of keyword is positioned by finding user name, then search the web page element on the right side of it, it is possible to fixed Position user name input frame element.
When the web page element consistent with the relative position and the instruction of position finger URL for positioning keyword when lookup has multiple, As shown in figure 3, web page element to be positioned is city's input frame, Search and Orientation keyword is better address, and position finger URL is right side When, the web page element on the right side of better address is searched, city's input frame, area's input frame, the multiple webpages of county's input frame can be found Element is, it is necessary to which it is web page element to be positioned to take the web page element nearest wherein with positioning the positional distance of keyword.Pass through The coordinate data of city's input frame, area's input frame, the coordinate data of the multiple web page elements of county's input frame and better address is compared Compared with, and then can determine that coordinate data city's input frame element nearest on the right side of the coordinate data of better address is net to be positioned Page element.Further, coordinate data of the positioning keyword in webpage can also be obtained by Search and Orientation keyword.According to The coordinate for positioning keyword is searched positioned at the web page element positioned near keyword.From the webpage member near positioning keyword The web page element consistent with the relative position and the instruction of position finger URL for positioning keyword is filtered out in element.Such as find in detail Coordinate data of the address in webpage, all web page elements near better address are searched according to coordinate data, there is login The web page element such as name, login name input frame, confirming button.Found from these web page elements according to coordinate data positioned at better address Coordinate on the right side of city's input frame element.
According to the localization method of web page element provided by the invention, receive input includes the character string for positioning keyword, The web page element with positioning keyword match can be positioned by way of traversal.Further when further specify position finger URL When, the web page element consistent with the relative position and the instruction of position finger URL for positioning keyword is searched, can accurately be positioned Web page element.So that when positioning web page element, without codes such as html, the js checked in webpage, go to find web page code In definition to element.The multi-aspect informations such as word that can be directly from web displaying, position relationship, are realized to web page element Positioning, the limitation that code could be positioned must be read by breaking away from, easy easily to perform.
Fig. 4 shows the flow chart of the localization method of web page element in accordance with another embodiment of the present invention.Such as Fig. 4 institutes Show, the localization method of web page element specifically comprises the following steps:
Step S201, receive the character string for including positioning keyword of input.
Step S202, judge whether that character string is provided with window ID.
In character string in addition to comprising positioning keyword, position finger URL, window ID can also be included.Window ID is Window title.When multiple webpages be present, certain button or linking element are such as clicked in webpage A, webpage B is ejected, existing simultaneously Two webpages;Or certain button or linking element in webpage clicking B, ejection webpage C, while three webpages be present again;Or may be used also There is a situation where to continue to eject multiple webpages.If search an element to be positioned, due to there is the presence of multiple webpages, search When multiple webpages are searched, more time can be spent;Or have at least two webpages when identical web page element be present, it is right When web page element is positioned, Wrong localization easily occurs.Therefore, can be in character string for the lookup of more accurate quick Window ID is set, that is, the title of the web page windows where web page element to be positioned is set., can be accurately fast by window ID The seeking scope by element to be positioned of speed is limited in specific web page windows.Such as element to be positioned is in webpage B, window mark Know for webpage B window title.
If judging, character string is provided with window ID, performs step S203.If judge to be not provided with window in character string Mark, subsequent operation can continue to judge character string judge whether include position finger URL in character string, if including position Finger URL is put, searches the web page element consistent with the relative position and the instruction of position finger URL for positioning keyword.If do not include Position finger URL, travel through the web page element with positioning keyword match in webpage.
Step S203, travel through the web page element with positioning keyword match in window corresponding with window ID.
If judging, character string is provided with window ID, travels through each window first, finds window corresponding with window ID. After finding window, subsequent operation can continue to judge character string, judge whether include position finger URL in character string, if Comprising position finger URL, the webpage consistent with the relative position and the instruction of position finger URL for positioning keyword is searched in the window Element.If not including position finger URL, in cycling among windows with position keyword match web page element.Step S203 execution Journey can be found in above-mentioned steps S102- steps S104 description, will not be repeated here.
According to the localization method of web page element provided by the invention, first multiple web page windows are determined by window ID Position, then element to be positioned is searched in the window of positioning, reduce and search the time that multiple windows are spent.Simultaneously avoid by When identical web page element in multiple webpages be present, Wrong localization occurred is positioned to web page element.
Fig. 5 shows the functional block diagram of the positioner of web page element according to an embodiment of the invention.Such as Fig. 5 institutes Show, the positioner of web page element includes following module:
Receiving module 301, suitable for receiving the character string for including positioning keyword of input.
Webpage includes many elements, has the input frame element for input, button element, provides the member that link redirects Element, also choice box element, word for prompt message etc..Log-on webpage as shown in Figure 2, show in webpage such as with Name in an account book, password, remember the prompt message word such as user name, there is its corresponding input frame element, radio box member by these words Element, further comprises in webpage such as log in, cancel button element, linking element returns to upper page.Positioning keyword derives from webpage The word of middle display, can be the word for prompt message, such as user name, password;It can also be the text in linking element Word, such as return to upper page;The word that button element is shown is can also be, is such as cancelled.Further, it can be in webpage to position keyword A part for the word of display, such as return.
Positioning keyword is set according to web page element to be positioned, the positioning keyword that receiving module 301 receives with it is undetermined The web page element of position is related.When such as web page element to be positioned is the input frame of password, the positioning that receiving module 301 receives is crucial Word is password or close.When such as web page element to be positioned is login button, the positioning keyword that receiving module 301 receives is to step on Record.When such as web page element to be positioned is linking element, the positioning keyword that receiving module 301 receives for the upper page of return or returns Return.
Finger URL judge module 302, suitable for judging whether include position finger URL in character string.
In character string in addition to comprising positioning keyword, position finger URL can also be included.Position finger URL is used to indicate to determine The relative position of position keyword and web page element to be positioned.Log-on webpage as shown in Figure 2, when web page element to be positioned is password Input frame when, for the positioning keyword that receiving module 301 receives when being arranged to password, position finger URL is cipher text and password Input frame relative position, for Password Input frame on the right side of cipher text, position finger URL is right side;Receiving module 301 connects The positioning keyword of receipts is when remembeing user name, position finger URL is the relative position for the input frame for remembeing user name word and password Put, Password Input frame is remembeing the upside of user name word, and position finger URL is upside.When web page element to be positioned is pressed for login During button, the positioning keyword that receiving module 301 receives is when logging in, and logs in word with login button in same place, therefore be not required to Will set location finger URL again;When the positioning keyword that receiving module 301 receives is cancels, login button is cancelling a left side for word Side, position finger URL are left side.
Finger URL judge module 302 judges whether include position finger URL in character string, if comprising execution finger URL is searched Module 304, otherwise, perform element spider module 303.
Element spider module 303, if suitable for not including position finger URL in character string, travel through crucial with positioning in webpage The web page element of word matching.
Element spider module 303 travels through the web page element in webpage, searches the web page element to match with positioning keyword. When being logged in such as element spider module 303 by positioning keyword come locating web-pages element login button, for the net of log-on webpage Location generates the object of log-on webpage, and element spider module 303 travels through the element in webpage in web object, searches and login The web page element matched somebody with somebody.
Finger URL searching modul 304, if suitable for including position finger URL in character string, search the phase with positioning keyword Consistent web page element is indicated to position and position finger URL.
When containing position finger URL in character string, finger URL searching modul 304 is searched relative with positioning keyword Position and position finger URL indicate consistent web page element.Finger URL searching modul 304 can be with by Search and Orientation keyword The position of positioning keyword is found, further, finger URL searching modul 304 is searched positioned at the position finger URL side of positioning keyword Web page element.When such as element to be positioned is user name input frame, it is crucial that finger URL searching modul 304 finds user name positioning The position of word, then search the web page element on the right side of it, it is possible to position user name input frame element.
When the web page element consistent when the relative position and the instruction of position finger URL with positioning keyword has multiple, such as scheme Shown in 3, web page element to be positioned is city's input frame, and positioning keyword is better address, when position finger URL is right side, finger URL Searching modul 304 searches the web page element on the right side of better address, can find city's input frame, area's input frame, county's input frame Multiple web page elements, it is web page element to be positioned to take the web page element nearest wherein with positioning the positional distance of keyword.I.e. By the way that the coordinate data of city's input frame, area's input frame, the coordinate data of the multiple web page elements of county's input frame and better address is entered Row compares, and then determines that coordinate data city's input frame element nearest on the right side of the coordinate data of better address is net to be positioned Page element.
Further, finger URL searching modul 304 also includes following module:
Coordinate obtaining module 3041, suitable for obtaining coordinate of the positioning keyword in webpage.
Element searching modul 3042, suitable for searching the web page element near positioning keyword according to coordinate.
Element locating module 3043, it is crucial with positioning suitable for being filtered out from the web page element near positioning keyword The relative position and position finger URL of word indicate consistent web page element.
The Search and Orientation keyword of coordinate obtaining module 3041, obtain coordinate data of the positioning keyword in webpage.Element Searching modul 3042 searches the web page element near positioning keyword according to the coordinate of positioning keyword.Element locating module 3043 filter out the relative position and position finger URL with positioning keyword from the web page element near positioning keyword Indicate consistent web page element.As coordinate obtaining module 3041 finds coordinate data of the better address in webpage, element Searching modul 3042 searches all web page elements near better address according to coordinate data, has login name, login name defeated Enter the web page elements such as frame, confirming button.Element locating module 3043 is found positioned at detailed from these web page elements according to coordinate data City's input frame element on the right side of the coordinate of thin address.
According to the positioner of web page element provided by the invention, receive input includes the character string for positioning keyword, The web page element with positioning keyword match can be positioned by way of traversal.Further when further specify position finger URL When, the web page element consistent with the relative position and the instruction of position finger URL for positioning keyword is searched, can accurately be positioned Web page element.So that when positioning web page element, without codes such as html, the js checked in webpage, go to find web page code In definition to element.The multi-aspect informations such as word that can be directly from web displaying, position relationship, are realized to web page element Positioning, the limitation that code could be positioned must be read by breaking away from, easy easily to perform.
Fig. 6 shows the functional block diagram of the positioner of web page element in accordance with another embodiment of the present invention.With Fig. 5 phases Than difference is, the positioner of web page element also includes:
Window ID judge module 305, suitable for determining whether that character string is provided with window ID.
In character string in addition to comprising positioning keyword, position finger URL, window ID can also be included.Window ID is Window title.When multiple webpages be present, certain button or linking element are such as clicked in webpage A, webpage B is ejected, existing simultaneously Two webpages;Or certain button or linking element in webpage clicking B, ejection webpage C, while three webpages be present again;Or may be used also There is a situation where to continue to eject multiple webpages.If search an element to be positioned, due to there is the presence of multiple webpages, search When multiple webpages are searched, more time can be spent;Or have at least two webpages when identical web page element be present, it is right When web page element is positioned, Wrong localization easily occurs.Therefore, can be in character string for the lookup of more accurate quick Window ID is set, that is, the title of the web page windows where web page element to be positioned is set., can be accurately fast by window ID The seeking scope by element to be positioned of speed is limited in specific web page windows.Such as element to be positioned is in webpage B, window mark Know for webpage B window title.
If window ID judge module 305 judges to be not provided with window ID in character string, subsequent operation can continue to hold Row finger URL judge module 302 is judged character string, if finger URL judge module 302 judges comprising position to determine in character string Position symbol, it is consistent with the relative position and the instruction of position finger URL for positioning keyword to perform the lookup of finger URL searching modul 304 Web page element.If finger URL judge module 302 judges not including position finger URL in character string, element spider module 303 is performed Travel through the web page element with positioning keyword match in webpage.
If window ID judge module 305 judges that character string is provided with window ID, finger URL judge module is continued executing with 302 pairs of character strings judge, if finger URL judge module 302 judges to include position finger URL in character string, perform finger URL Searching modul 304 travels through each window, finds window corresponding with window ID.After finding window, search in the window with positioning The relative position and position finger URL of keyword indicate consistent web page element.If finger URL judge module 302 judges character Do not include position finger URL in string, perform element spider module 303 and travel through each window, find window corresponding with window ID. After finding window, the web page element with positioning keyword match in the window is traveled through.
According to the positioner of web page element provided by the invention, first multiple web page windows are determined by window ID Position, then element to be positioned is searched in the window of positioning, reduce and search the time that multiple windows are spent.Simultaneously avoid by When identical web page element in multiple webpages be present, Wrong localization occurred is positioned to web page element.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with teaching based on this.As described above, required by constructing this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that it can utilize various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description to the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor The application claims of shield features more more than the feature being expressly recited in each claim.It is more precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself Separate embodiments all as the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit requires, summary and accompanying drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation Replace.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be realized with hardware, or to be run on one or more processor Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that it can use in practice Microprocessor or digital signal processor (DSP) are realized in the positioner of web page element according to embodiments of the present invention The some or all functions of some or all parts.The present invention is also implemented as being used to perform method as described herein Some or all equipment or program of device (for example, computer program and computer program product).Such reality The program of the existing present invention can store on a computer-readable medium, or can have the form of one or more signal. Such signal can be downloaded from internet website and obtained, and either be provided or in the form of any other on carrier signal There is provided.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of some different elements and being come by means of properly programmed computer real It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame Claim.
The invention also discloses:
A1, a kind of localization method of web page element, it includes:
The character string for including positioning keyword of input is received, the positioning keyword derives from the text shown in webpage Word;
Judge position finger URL whether is included in the character string, the position finger URL is used to indicate that the positioning is crucial The relative position of word and the web page element to be positioned;
If not including the position finger URL in the character string, travel through in the webpage and position keyword with described The web page element matched somebody with somebody;
If including the position finger URL in the character string, search and the relative position of the positioning keyword and institute Rheme puts finger URL and indicates consistent web page element.
A2, the method according to A1, wherein, the positioning keyword is a part for the word shown in webpage.
A3, the method according to A1 or A2, wherein, relative position and the position of the lookup with positioning keyword Finger URL indicates that consistent web page element further comprises:
Search consistent with the relative position for positioning keyword and position finger URL instruction and with positioning keyword The nearest web page element of positional distance.
A4, the method according to any one of A1-A3, wherein, relative position and institute of the lookup with positioning keyword Rheme puts finger URL and indicates that consistent web page element further comprises:
Obtain coordinate of the positioning keyword in the webpage;
Web page element near the positioning keyword is searched according to the coordinate;
Filtered out from the web page element near the positioning keyword and the relative position of positioning keyword and institute Rheme puts finger URL and indicates consistent web page element.
A5, the method according to any one of A1-A4, wherein, in the word for including positioning keyword for receiving input After symbol string, methods described also includes:Judge whether that the character string is provided with window ID;
It is further with the web page element for positioning keyword match in the traversal webpage:If judge described Character string is provided with window ID, then travels through the net with the positioning keyword match in window corresponding with the window ID Page element;
The lookup web page element consistent with the relative position and position finger URL instruction that position keyword enters One step is:If judging, the character string is provided with window ID, searches in window corresponding with the window ID with determining The relative position of position keyword and the position finger URL indicate consistent web page element.
A6, the method according to A5, wherein, the window ID is window title.
B7, a kind of positioner of web page element, it includes:
Receiving module, suitable for receiving the character string for including positioning keyword of input, the positioning keyword derives from net The word shown in page;
Finger URL judge module, suitable for judging whether include position finger URL, the position finger URL in the character string For indicating the relative position of the positioning keyword and the web page element to be positioned;
Element spider module, if suitable for not including the position finger URL in the character string, travel through in the webpage With the web page element of the positioning keyword match;
Finger URL searching modul, if suitable for including the position finger URL in the character string, search and the positioning The relative position of keyword and the position finger URL indicate consistent web page element.
B8, the device according to B7, wherein, the positioning keyword is a part for the word shown in webpage.
B9, the device according to B7 or B8, wherein, the finger URL searching modul is further adapted for:Search and position The relative position of keyword and the position finger URL indicate consistent and nearest with positioning the positional distance of keyword webpage Element.
B10, the device according to any one of B7-B9, wherein, the finger URL searching modul also includes:
Coordinate obtaining module, suitable for obtaining coordinate of the positioning keyword in the webpage;
Element searching modul, suitable for searching the web page element near the positioning keyword according to the coordinate;
Element locating module, it is crucial with positioning suitable for being filtered out from the web page element near the positioning keyword The relative position of word and the position finger URL indicate consistent web page element.
B11, the device according to any one of B7-B10, wherein, device also includes:
Window ID judge module, suitable for judging whether that the character string is provided with window ID;
The element spider module is further adapted for:If judging, the character string is provided with window ID, traversal with In window corresponding to the window ID with it is described positioning keyword match web page element;
The finger URL searching modul is further adapted for:If judging, the character string is provided with window ID, searches With the window ID corresponding in window it is consistent with the relative position and position finger URL instruction that position keyword Web page element.
B12, the device according to B11, wherein, the window ID is window title.

Claims (10)

1. a kind of localization method of web page element, it includes:
The character string for including positioning keyword of input is received, the positioning keyword derives from the word shown in webpage;
Judge position finger URL whether is included in the character string, the position finger URL be used for indicate it is described positioning keyword with The relative position of the web page element to be positioned;
If do not include the position finger URL in the character string, travel through in the webpage with the positioning keyword match Web page element;
If including the position finger URL in the character string, relative position and institute's rheme with the positioning keyword are searched Put finger URL and indicate consistent web page element.
2. according to the method for claim 1, wherein, the positioning keyword is a part for the word shown in webpage.
3. method according to claim 1 or 2, wherein, the lookup and the relative position and institute's rheme of positioning keyword Put finger URL and indicate that consistent web page element further comprises:
Search with positioning keyword relative position and position finger URL instruction it is consistent and with positioning keyword position Closest web page element.
4. according to the method described in claim any one of 1-3, wherein, relative position and institute of the lookup with positioning keyword Rheme puts finger URL and indicates that consistent web page element further comprises:
Obtain coordinate of the positioning keyword in the webpage;
Web page element near the positioning keyword is searched according to the coordinate;
The relative position and institute's rheme with positioning keyword are filtered out from the web page element near the positioning keyword Put finger URL and indicate consistent web page element.
5. according to the method described in claim any one of 1-4, wherein, in the word for including positioning keyword for receiving input After symbol string, methods described also includes:Judge whether that the character string is provided with window ID;
It is further with the web page element for positioning keyword match in the traversal webpage:If judge the character String is provided with window ID, then travels through the webpage member with the positioning keyword match in window corresponding with the window ID Element;
The lookup web page element consistent with the relative position and position finger URL instruction that position keyword is further For:If judging, the character string is provided with window ID, searches in window corresponding with the window ID and is closed with positioning The relative position of key word and the position finger URL indicate consistent web page element.
6. according to the method for claim 5, wherein, the window ID is window title.
7. a kind of positioner of web page element, it includes:
Receiving module, suitable for receiving the character string for including positioning keyword of input, the positioning keyword is derived from webpage The word of display;
Finger URL judge module, suitable for judging whether include position finger URL in the character string, the position finger URL is used for Indicate the relative position of the positioning keyword and the web page element to be positioned;
Element spider module, if suitable for not including the position finger URL in the character string, travel through in the webpage with institute State the web page element of positioning keyword match;
Finger URL searching modul, if suitable for including the position finger URL in the character string, search crucial with the positioning The relative position of word and the position finger URL indicate consistent web page element.
8. device according to claim 7, wherein, the positioning keyword is a part for the word shown in webpage.
9. the device according to claim 7 or 8, wherein, the finger URL searching modul is further adapted for:Search and position The relative position of keyword and the position finger URL indicate consistent and nearest with positioning the positional distance of keyword webpage Element.
10. according to the device described in claim any one of 7-9, wherein, the finger URL searching modul also includes:
Coordinate obtaining module, suitable for obtaining coordinate of the positioning keyword in the webpage;
Element searching modul, suitable for searching the web page element near the positioning keyword according to the coordinate;
Element locating module, suitable for being filtered out and positioning keyword from the web page element near the positioning keyword Relative position and the position finger URL indicate consistent web page element.
CN201610520639.1A 2016-07-04 2016-07-04 Webpage element positioning method and device Active CN107577592B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610520639.1A CN107577592B (en) 2016-07-04 2016-07-04 Webpage element positioning method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610520639.1A CN107577592B (en) 2016-07-04 2016-07-04 Webpage element positioning method and device

Publications (2)

Publication Number Publication Date
CN107577592A true CN107577592A (en) 2018-01-12
CN107577592B CN107577592B (en) 2024-04-19

Family

ID=61049392

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610520639.1A Active CN107577592B (en) 2016-07-04 2016-07-04 Webpage element positioning method and device

Country Status (1)

Country Link
CN (1) CN107577592B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101419620A (en) * 2008-12-03 2009-04-29 腾讯科技(深圳)有限公司 Method for shielding web page element and apparatus thereof
US20100082673A1 (en) * 2008-09-30 2010-04-01 Kabushiki Kaisha Toshiba Apparatus, method and program product for classifying web browsing purposes
CN102902723A (en) * 2012-09-06 2013-01-30 北京北森测评技术有限公司 Method and device for analyzing network data
CN103631875A (en) * 2013-11-08 2014-03-12 北京奇虎科技有限公司 Method for carrying out network search on browser side and browser
CN104965912A (en) * 2015-07-06 2015-10-07 安一恒通(北京)科技有限公司 Information acquisition method and apparatus
CN104980404A (en) * 2014-04-10 2015-10-14 腾讯科技(深圳)有限公司 Method and system for protecting account information security

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100082673A1 (en) * 2008-09-30 2010-04-01 Kabushiki Kaisha Toshiba Apparatus, method and program product for classifying web browsing purposes
CN101419620A (en) * 2008-12-03 2009-04-29 腾讯科技(深圳)有限公司 Method for shielding web page element and apparatus thereof
CN102902723A (en) * 2012-09-06 2013-01-30 北京北森测评技术有限公司 Method and device for analyzing network data
CN103631875A (en) * 2013-11-08 2014-03-12 北京奇虎科技有限公司 Method for carrying out network search on browser side and browser
CN104980404A (en) * 2014-04-10 2015-10-14 腾讯科技(深圳)有限公司 Method and system for protecting account information security
CN104965912A (en) * 2015-07-06 2015-10-07 安一恒通(北京)科技有限公司 Information acquisition method and apparatus

Also Published As

Publication number Publication date
CN107577592B (en) 2024-04-19

Similar Documents

Publication Publication Date Title
US9767009B2 (en) Adaptation of automated test scripts
CN103632100B (en) A kind of website vulnerability detection method and device
EP3665885B1 (en) System and method to check automation system project security vulnerabilities
US20160261475A1 (en) System and method for accessibility assessment of a web application
WO2009070410A1 (en) System and method for navigating in technical data
US10169037B2 (en) Identifying equivalent JavaScript events
EP3411796A1 (en) Methods and systems for software related problem solution
US20140317489A1 (en) Device-independent validation of website elements
CN106844486A (en) Crawl the method and device of dynamic web page
US7685195B2 (en) Systems and methods for analyzing web site search terms
CN103870573A (en) Method and device for website analysis
CN108259244A (en) Client application failure drilling method and device
KR20180129623A (en) Apparatus for statically analyzing assembly code including assoxiated multi files
CN104025089B (en) The method and system creeped based on situation
US10489728B1 (en) Generating and publishing a problem ticket
KR101144371B1 (en) Method and system for visualizing webpage browsing history and method and system for providing additional information using the webpage browsing history
US10339119B2 (en) Calibration of a first search query based on a second search query
US10360268B2 (en) Result set optimization for a search query
CN105138912A (en) Method and device for generating phishing website detection rules automatically
CN107577592A (en) The localization method and device of web page element
US10108525B2 (en) Optimizing automated interactions with web applications
CN104462519A (en) Search query method and device
CN101903862A (en) Method and system for setting up a computer system at startup
Sabharwal et al. Modeling the navigation behavior of dynamic web applications
Kacimi et al. Creating a reference technology platform: Performing model-based safety analysis in a heterogeneous development environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Applicant after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Applicant after: Beijing Qizhi Business Consulting Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Applicant before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Applicant before: Qizhi software (Beijing) Co.,Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240108

Address after: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Applicant after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Applicant before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Applicant before: Beijing Qizhi Business Consulting Co.,Ltd.

GR01 Patent grant
GR01 Patent grant