CN111177633B - Automatic filling method and device for web form, storage medium and electronic equipment - Google Patents
Automatic filling method and device for web form, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN111177633B CN111177633B CN201911422246.7A CN201911422246A CN111177633B CN 111177633 B CN111177633 B CN 111177633B CN 201911422246 A CN201911422246 A CN 201911422246A CN 111177633 B CN111177633 B CN 111177633B
- Authority
- CN
- China
- Prior art keywords
- target
- type
- action
- control
- control type
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the invention provides an automatic filling method, an automatic filling device, a storage medium and electronic equipment for a web form. The automatic filling method of the webpage form comprises the steps of firstly determining a target action type of the webpage form to be filled in, and then obtaining target parameters corresponding to the target action type. And then, based on the target parameters, executing the webpage form filling action corresponding to the target parameters, thereby realizing automatic form filling. In addition, the configuration template in the scheme is realized based on Excel, so that the applicability is high.
Description
Technical Field
The invention relates to the technical field of data management, in particular to an automatic filling method and device for a webpage form, a storage medium and electronic equipment.
Background
In daily work, repeated filling of some web forms is often required, such as web form operations of version input and output warehouse-in application, work approval, man-hour registration, etc. The work content is simple and repeated, is easy to make mistakes, and needs to consume a great deal of manpower. The inventor finds that the current automatic filling tool for the webpage form needs to install a plug-in, and part of scenes cannot apply the automatic filling tool for the webpage form, for example, when a modal dialog box is popped up and the text box is input, after the cursor leaves, the scene of an event is triggered.
Therefore, how to automatically fill out a web form, which can automatically fill out a form and enhance applicability, is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
Therefore, the embodiment of the invention provides an automatic filling method for the web form, which can automatically fill in the form and enhance the applicability.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
the automatic filling method of the webpage form is based on a configuration template, the configuration template at least comprises an action type and parameters corresponding to the action type, the action type is used for executing corresponding target actions based on the parameters, the action type comprises an enabling IE, a single layer of the action type is used for finding a serial number according to a label, two layers of the action type are used for finding serial numbers according to the label, a frame and a simulation key, and the automatic filling method of the webpage form comprises the following steps:
determining a target action type of a webpage form to be filled in;
obtaining target parameters corresponding to the target action types, wherein the target parameters at least comprise one or more of a storage website, a text label, a control type, a search radius of the control type, a search direction of the control type, a search range of the control type, a frame name, a serial number of the control type and a key code of a keyboard;
And executing the webpage form filling action corresponding to the target parameter based on the target parameter.
Optionally, the determining the target action type of the webpage form to be filled in includes:
obtaining html source codes of the webpage form to be filled in;
and determining the target action type of the webpage form to be filled in based on the html source code.
Optionally, the obtaining the target parameter corresponding to the action type includes:
judging the target action type;
when the target action type is the starting IE, determining the storage website as the target parameter;
when the action type is that the single layer finds a sequence number according to a label, determining the Wen Zibiao signature, the control type, the searching radius of the control type, the searching direction of the control type and the searching range of the control type as the target parameters;
when the action type is that the two layers find sequence numbers according to labels, determining that a first layer of Wen Zibiao signature, a second layer of text label name, a first layer of control type, a second layer of control type, a search direction of the first layer of control type and a search direction of the second layer of control type are the target parameters;
When the action type is the frame, determining that the frame name, the control type and the serial number of the control type are the target parameters;
and when the action type is the simulated key, determining a key position code of the keyboard as the target parameter.
Optionally, the executing the webpage form filling action corresponding to the target parameter based on the target parameter includes:
when the target action type is the starting IE, opening a browser based on the storage website;
when the action type is that the single layer finds a serial number according to a label, a first serial number of a label corresponding to the character label name in a structure body is determined based on the character label name, a global serial number of a first target control adjacent to the first serial number is determined based on the first serial number, a searching radius of the control type, a searching direction of the control type and a searching range of the control type, and a preset action is executed on the first target control based on the global serial number and the control type of the first target control, wherein the preset action comprises assignment, clicking, positioning and attribute value reading;
When the action type is that the two layers find sequence numbers according to labels, a father control is determined based on the Wen Zibiao signature of the first layer, the control type of the first layer and the searching direction of the control type of the first layer, the global sequence number of a second target control is determined based on the Wen Zibiao signature of the second layer, the control type of the second layer and the searching direction of the control type of the second layer, and a preset action is executed on the second target control based on the global sequence number, wherein the preset action comprises assignment, clicking, positioning and attribute value reading;
when the action type is the frame, determining a global sequence number of a third target control based on the frame name, the control type and the sequence number of the control type, and executing a preset action on the third target control based on the global sequence number, wherein the preset action comprises assignment, clicking, positioning and attribute value reading;
and when the action type is the simulated key, executing an action corresponding to a key position code of the keyboard.
An automatic filling device of a web form, based on a configuration template, the configuration template at least comprises an action type and a parameter corresponding to the action type, the action type is used for executing a corresponding target action based on the parameter, the action type comprises an enabling IE, a single layer of serial numbers according to labels, two layers of serial numbers according to labels, a frame and a simulation key, and the automatic filling device of the web form comprises:
The determining module is used for determining the target action type of the webpage form to be filled in;
the acquisition module is used for acquiring target parameters corresponding to the target action types, wherein the target parameters at least comprise one or more of a storage website, a text label, a control type, a search radius of the control type, a search direction of the control type, a search range of the control type, a frame name, a serial number of the control type and a key code of a keyboard;
and the execution module is used for executing the webpage form filling action corresponding to the target parameter based on the target parameter.
Optionally, the determining module includes:
the acquisition unit is used for acquiring html source codes of the webpage form to be filled in;
the first determining unit is used for determining the target action type of the webpage form to be filled in based on the html source code.
Optionally, the acquiring module includes:
the judging unit is used for judging the target action type;
the second determining unit is configured to determine that the storage website is the target parameter when the target action type is the start IE;
the third determining unit is configured to determine, when the action type is that the single layer finds a sequence number according to a label, that the Wen Zibiao signature, the control type, a search radius of the control type, a search direction of the control type, and a search range of the control type are the target parameters;
A fourth determining unit, configured to determine, when the action type is the two layers of search numbers according to labels, that a first layer of the Wen Zibiao signature, a second layer of the text label name, a first layer of the control type, a second layer of the control type, a search direction of the first layer of the control type, and a search direction of the second layer of the control type are the target parameters;
a fifth determining unit, configured to determine, when the action type is the frame, that the frame name, the control type, and a sequence number of the control type are the target parameters;
and a sixth determining unit, configured to determine, when the action type is the simulated key, that a key position code of the keyboard is the target parameter.
Optionally, the execution module includes:
the first execution unit is used for opening a browser based on the storage website when the target action type is the starting IE;
the second execution unit is used for determining a first serial number of a label corresponding to the text label name in a structure body based on the text label name when the action type is that the single layer finds the serial number according to the label, determining a global serial number of a first target control adjacent to the first serial number based on the first serial number, a search radius of the control type, a search direction of the control type and a search range of the control type, and executing preset actions on the first target control based on the global serial number and the control type of the first target control, wherein the preset actions comprise assignment, clicking, positioning and attribute value reading;
The third execution unit is used for determining a parent control based on the Wen Zibiao signature of the first layer, the control type of the first layer and the searching direction of the control type of the first layer when the action type is the sequence number of the two layers according to the label, determining the global sequence number of the second target control based on the Wen Zibiao signature of the second layer, the control type of the second layer and the searching direction of the control type of the second layer, and executing preset actions on the second target control based on the global sequence number, wherein the preset actions comprise assignment, clicking, positioning and attribute value reading;
the fourth execution unit is used for determining the global sequence number of the third target control based on the frame name, the control type and the sequence number of the control type when the action type is the frame, and executing a preset action on the third target control based on the global sequence number, wherein the preset action comprises assignment, clicking, positioning and attribute value reading;
and the fifth execution unit is used for executing the action corresponding to the key position code of the keyboard when the action type is the analog key.
A storage medium comprising a stored program, wherein the program, when run, controls a device in which the storage medium resides to execute any one of the above-described automatic filling methods of web forms.
An electronic device comprising at least one processor, and at least one memory, bus, connected to the processor; the processor and the memory complete communication with each other through the bus; the processor is used for calling the program instructions in the memory to execute any one of the automatic filling methods of the web page forms.
Based on the above technical scheme, the embodiment of the invention provides an automatic filling method, an automatic filling device, a storage medium and electronic equipment for a web form, wherein the method is based on a configuration template, the configuration template at least comprises an action type and parameters corresponding to the action type, the action type is used for executing corresponding target actions based on the parameters, and the action type comprises an activation IE, a single layer of serial number according to a label, two layers of serial number according to the label, a frame and a simulation key. The automatic filling method of the webpage form comprises the steps of firstly determining a target action type of the webpage form to be filled in, and then obtaining target parameters corresponding to the target action type. The target parameters at least comprise one or more of a storage website, a text label, a control type, a search radius of the control type, a search direction of the control type, a search range of the control type, a frame name, a serial number of the control type and a key code of a keyboard. And then, based on the target parameters, executing the webpage form filling action corresponding to the target parameters, thereby realizing automatic form filling. In addition, the configuration template in the scheme is realized based on Excel, so that the applicability is high.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an automatic filling method for web page forms according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a header of a configuration template according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of action types in an automatic filling method of a web page form according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of an automatic filling method for web page forms according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of an automatic filling method for web page forms according to an embodiment of the present invention;
FIG. 6 is a schematic flow chart of an automatic filling method for web page forms according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an automatic filling device for web page forms according to an embodiment of the present invention;
Fig. 8 is a schematic diagram of a hardware architecture of an electronic device according to an embodiment of the present invention.
Detailed Description
Referring to fig. 1, fig. 1 is a flow chart of an automatic filling method of a web page form according to an embodiment of the present invention, wherein the automatic filling method of the web page form is based on a configuration template shown in fig. 2, the configuration template is written in a sheet of Excel, and at least includes an action type and a parameter corresponding to the action type, and the action type is used for executing a corresponding target action based on the parameter. Wherein "valid" indicates whether or not to perform the step, and the value is: yes/no, no or null skips this step. "step description" is used for the purpose of describing the execution of this step. The "action type" is a few methods of manipulating the operation web page form, as described in more detail below. The 6 parameters 1-6 are parameters used by the action type, the number of the parameters used by different action types and the meaning of the parameters are different, and the method mainly comprises the following steps: the text label name in the Html form, the content of the text box to be input, the tagname of the control, the radius and direction of the search tagname (forward and backward), and the mode of searching the label name (global and local). The "number of sleep seconds" characterizes the number of seconds that the program has been sleep in this step, and is the time to reserve a response to the page.
In addition, in this embodiment, as shown in fig. 3, the action types include start IE, single layer according to label serial number, two layers according to label serial number, frame and analog key. The automatic filling method of the webpage form comprises the following steps:
s11, determining the target action type of the webpage form to be filled in.
The Html form is composed of a plurality of Html elements, each line and each column in the form and each interface element correspond to one element in the Html, and the filling of the form is to assign or click the Html elements. In the embodiment, the position of the target control is determined by understanding the form structure, and after the position of the control is locked, operations such as assignment, value taking, clicking, choosing and the like can be performed on the control.
Specifically, the locked control can be directly determined through the control ID, but sometimes the control has no ID, so the scheme provides a specific implementation method for determining the control position based on the text label. The method comprises the steps of locating the text label, finding the position of a target control from the position, and performing operations such as assignment, value acquisition, clicking, selection and the like on the control by using an IE.
Based on the above embodiments, the embodiment of the present invention provides a specific implementation manner for determining a target action type of a to-be-filled web page form, as shown in fig. 4, including the steps of:
s41, obtaining html source codes of the webpage form to be filled in;
s42, determining the target action type of the webpage form to be filled in based on the html source code.
That is, before using, the embodiment needs to analyze the to-be-filled web page form, and in general, the browser has the function of a developer tool, and can obtain the html source code of the web page form after opening the browser, and then perform configuration of the execution steps according to the configuration template according to the analysis of the html source code.
Because, in this solution, the configuration templates are written in the sheet of Excel, each row represents a step, and each row has a fixed column composition. Therefore, after the execution step is configured, the button is clicked [ execution ], and the VBA program is read and executed row by row, so that the function of filling in the one-key form is realized.
S12, acquiring target parameters corresponding to the target action types.
Specifically, the foregoing implementation manner is further described, where in this embodiment, the target parameter includes at least one or more of a storage website, a text label, a control type, a search radius of the control type, a search direction of the control type, a search range of the control type, a frame name, a serial number of the control type, and a key code of the keyboard.
It should be noted that, in this embodiment, different action types correspond to different operations, so, as shown in fig. 5, this embodiment provides several specific implementation manners for obtaining the target parameters corresponding to the action types, including:
s51, judging the target action type;
s52, when the target action type is the starting IE, determining the storage website as the target parameter;
s53, when the action type is that the single layer finds a serial number according to a label, determining that the Wen Zibiao signature, the control type, the searching radius of the control type, the searching direction of the control type and the searching range of the control type are the target parameters;
s54, when the action type is that the two layers find serial numbers according to labels, determining that a first layer of Wen Zibiao signature, a second layer of text label name, a first layer of control type, a second layer of control type, a search direction of the first layer of control type and a search direction of the second layer of control type are the target parameters;
s55, when the action type is the frame, determining that the frame name, the control type and the serial number of the control type are the target parameters;
And S56, when the action type is the simulated key, determining the key position code of the keyboard as the target parameter.
And S13, based on the target parameters, executing the webpage form filling action corresponding to the target parameters.
TABLE 1
After the target parameters are acquired, in combination with table 1 and fig. 6, the method executes a webpage form filling action corresponding to the target parameters, including:
and S61, when the target action type is the starting IE, opening a browser based on the storage website.
Specifically, the calling method ie=createobject ("internet protocol ON"), creates an IE object, and opens a web page through the IE.
And S62, when the action type is that the single layer finds a serial number according to a label, determining a first serial number of a label corresponding to the text label name in a structure body based on the text label name, determining a global serial number of a first target control adjacent to the first serial number based on the first serial number, a search radius of the control type, a search direction of the control type and a search range of the control type, and executing preset actions on the first target control based on the global serial number and the control type of the first target control, wherein the preset actions comprise assignment, clicking, positioning and attribute value reading.
It should be noted that all labels and controls of the IE page are stored in the ie.document.all () structure array. If the control has a unique ID, then it can be located directly by IE. If it cannot be located directly by ID, it must find the serial number of the control in the structure by means of text labels around or inside the target control, and locate it by ie. After positioning, the value can be assigned through the structure body attribute; focus obtains cursor; clicking the click; and checking by using the closed.
Specifically, in this embodiment, the location of the text label name around the target control is found first, and then the target control is bound according to the tagname from the location, for example: the serial number of the label in IE.document.all () is found according to the literal label name, starting from the serial number, the serial number of the control of the first tagname is found before and after the serial number, and after locking, the control is operated by IE.document.all (serialno).
The operation method specifically looks at the type of the tab, and if the tab is an INPUT/TEXTAREAtab, the value of the control is assigned; the tagname is A/SPAN/TD/BUTTON/SELECT, and the focus and click methods of the control are called; the tab is CHECKBOX/RADIO, and the value of the closed of the control is assigned; if the tag is SPAN in the table control, the index attribute value of SPAN is read.
And S63, when the action type is that the two layers find serial numbers according to labels, determining a parent control based on the Wen Zibiao signature of the first layer, the control type of the first layer and the search direction of the control type of the first layer, determining the global serial number of a second target control based on the Wen Zibiao signature of the second layer, the control type of the second layer and the search direction of the control type of the second layer, and executing preset actions on the second target control based on the global serial number, wherein the preset actions comprise assignment, clicking, positioning and reading attribute values.
In this embodiment, if the control is a table, any field in this table may be located by nested substructures (resembling a two-dimensional array) of structures, rows (table row number), tags (tag type) (sequence number), or by nested substructures (resembling a one-dimensional array), all (sequence number). The table control in the IE.document has two views, one is a view of a one-dimensional array and the other is a view of a two-dimensional array.
For example, the applicable target child control occurs in a table control, and this table has no fixed ID and no row properties. After the parent control is locked through the first layer of text labels, IE.document.all (serialno) is obtained, then the control serial number of the target position is obtained through the second layer of text labels, and finally the space can be expressed as IE.document.all (serialno) all (localserialno), and the operation method after locking is the same as above.
And S64, when the action type is the frame, determining the global sequence number of a third target control based on the frame name, the control type and the sequence number of the control type, and executing a preset action on the third target control based on the global sequence number, wherein the preset action comprises assignment, clicking, positioning and reading attribute values.
Specifically, if a frame exists in the IE interface, the frame is positioned, and then the target control is found from the frame. The control is located, for example, by means of ie.
And S65, executing an action corresponding to the key position code of the keyboard when the action type is the simulated key.
Since some web pages pop up a modal dialog box (i.e., the web page cannot be manipulated without closing the dialog box) and the ID cannot be obtained to manipulate it, the present embodiment closes the dialog box by simulating a key and then continues to fill out the web page.
For example, assuming the analog key is the Enter key, it can be invoked directly in VBA by Ws.SendKeys "{ ENTER }".
Therefore, the scheme is based on Excel, and automatic filling of the form can be realized only by carrying out script configuration according to the template in the Excel, and filling of dynamic content with a certain logic relationship is supported.
In addition, the embodiment may also make some logic decisions by taking the control value, so as to determine that a certain step should not be executed, and dynamically generate text content in a preset format. For example, when filling out a daily work log, the work package is closed for a total of 80 hours, if the work package is filled up for 80 hours. The interface is a radio box with a "yes", "no" and an initialization of "no" if the package is closed. If the work package has been filled for 75 hours, the package can only be filled for another 5 hours, and to shut down the work package, the remaining 3 hours are filled with another work package.
Specifically, the method can be realized by the following logic:
firstly, the total working hour and the filled working hour of the work package are obtained according to the ID, then 5 is obtained by a calculation formula, and then the 'effective' of the step of closing the work package is set to be 'yes' according to the logic of 75+8> =80. Another work package was selected for the remaining 3 days to fill out.
On the basis of the above embodiment, as shown in fig. 7, the present embodiment further provides an automatic filling device for a web form, based on a configuration template, where the configuration template at least includes an action type and a parameter corresponding to the action type, the action type is used for executing a corresponding target action based on the parameter, the action type includes an initiation IE, a single layer of searching serial numbers according to labels, two layers of searching serial numbers according to labels, a frame, and a simulated key, and the automatic filling device for a web form includes:
A determining module 71, configured to determine a target action type of the webpage form to be filled in;
an obtaining module 72, configured to obtain a target parameter corresponding to the target action type, where the target parameter includes at least one or more of a storage website, a text label, a control type, a search radius of the control type, a search direction of the control type, a search range of the control type, a frame name, a serial number of the control type, and a key code of a keyboard;
and the execution module 73 is configured to execute a webpage form filling action corresponding to the target parameter based on the target parameter.
Wherein, the determining module may include:
the acquisition unit is used for acquiring html source codes of the webpage form to be filled in;
the first determining unit is used for determining the target action type of the webpage form to be filled in based on the html source code.
In addition, the acquiring module may include:
the judging unit is used for judging the target action type;
the second determining unit is configured to determine that the storage website is the target parameter when the target action type is the start IE;
the third determining unit is configured to determine, when the action type is that the single layer finds a sequence number according to a label, that the Wen Zibiao signature, the control type, a search radius of the control type, a search direction of the control type, and a search range of the control type are the target parameters;
A fourth determining unit, configured to determine, when the action type is the two layers of search numbers according to labels, that a first layer of the Wen Zibiao signature, a second layer of the text label name, a first layer of the control type, a second layer of the control type, a search direction of the first layer of the control type, and a search direction of the second layer of the control type are the target parameters;
a fifth determining unit, configured to determine, when the action type is the frame, that the frame name, the control type, and a sequence number of the control type are the target parameters;
and a sixth determining unit, configured to determine, when the action type is the simulated key, that a key position code of the keyboard is the target parameter.
In addition, the execution module may include:
the first execution unit is used for opening a browser based on the storage website when the target action type is the starting IE;
the second execution unit is used for determining a first serial number of a label corresponding to the text label name in a structure body based on the text label name when the action type is that the single layer finds the serial number according to the label, determining a global serial number of a first target control adjacent to the first serial number based on the first serial number, a search radius of the control type, a search direction of the control type and a search range of the control type, and executing preset actions on the first target control based on the global serial number and the control type of the first target control, wherein the preset actions comprise assignment, clicking, positioning and attribute value reading;
The third execution unit is used for determining a parent control based on the Wen Zibiao signature of the first layer, the control type of the first layer and the searching direction of the control type of the first layer when the action type is the sequence number of the two layers according to the label, determining the global sequence number of the second target control based on the Wen Zibiao signature of the second layer, the control type of the second layer and the searching direction of the control type of the second layer, and executing preset actions on the second target control based on the global sequence number, wherein the preset actions comprise assignment, clicking, positioning and attribute value reading;
the fourth execution unit is used for determining the global sequence number of the third target control based on the frame name, the control type and the sequence number of the control type when the action type is the frame, and executing a preset action on the third target control based on the global sequence number, wherein the preset action comprises assignment, clicking, positioning and attribute value reading;
and the fifth execution unit is used for executing the action corresponding to the key position code of the keyboard when the action type is the analog key.
The automatic filling device for the webpage form comprises a processor and a memory, wherein the determining module, the acquiring module, the executing module and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one, and the applicability is enhanced while the automatic filling of the form can be performed by adjusting the kernel parameters.
The embodiment of the application provides a storage medium, on which a program is stored, which when executed by a processor, implements the automatic filling method of the webpage form.
The embodiment of the application provides a processor which is used for running a program, wherein the automatic filling method of the webpage form is executed when the program runs.
The embodiment of the application provides a device, as shown in fig. 8, which comprises at least one processor 81, at least one memory 82 connected with the processor, and a bus 83; the processor and the memory complete communication with each other through a bus; the processor is used for calling the program instructions in the memory to execute the automatic filling method of the web page form. The device herein may be a server, PC, PAD, cell phone, etc.
The application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with the method steps of:
The automatic filling method of the webpage form is based on a configuration template, the configuration template at least comprises an action type and parameters corresponding to the action type, the action type is used for executing corresponding target actions based on the parameters, the action type comprises an enabling IE, a single layer of the action type is used for finding a serial number according to a label, two layers of the action type are used for finding serial numbers according to the label, a frame and a simulation key, and the automatic filling method of the webpage form comprises the following steps:
determining a target action type of a webpage form to be filled in;
obtaining target parameters corresponding to the target action types, wherein the target parameters at least comprise one or more of a storage website, a text label, a control type, a search radius of the control type, a search direction of the control type, a search range of the control type, a frame name, a serial number of the control type and a key code of a keyboard;
and executing the webpage form filling action corresponding to the target parameter based on the target parameter.
Optionally, the determining the target action type of the webpage form to be filled in includes:
obtaining html source codes of the webpage form to be filled in;
and determining the target action type of the webpage form to be filled in based on the html source code.
Optionally, the obtaining the target parameter corresponding to the action type includes:
judging the target action type;
when the target action type is the starting IE, determining the storage website as the target parameter;
when the action type is that the single layer finds a sequence number according to a label, determining the Wen Zibiao signature, the control type, the searching radius of the control type, the searching direction of the control type and the searching range of the control type as the target parameters;
when the action type is that the two layers find sequence numbers according to labels, determining that a first layer of Wen Zibiao signature, a second layer of text label name, a first layer of control type, a second layer of control type, a search direction of the first layer of control type and a search direction of the second layer of control type are the target parameters;
when the action type is the frame, determining that the frame name, the control type and the serial number of the control type are the target parameters;
and when the action type is the simulated key, determining a key position code of the keyboard as the target parameter.
Optionally, the executing the webpage form filling action corresponding to the target parameter based on the target parameter includes:
When the target action type is the starting IE, opening a browser based on the storage website;
when the action type is that the single layer finds a serial number according to a label, a first serial number of a label corresponding to the character label name in a structure body is determined based on the character label name, a global serial number of a first target control adjacent to the first serial number is determined based on the first serial number, a searching radius of the control type, a searching direction of the control type and a searching range of the control type, and a preset action is executed on the first target control based on the global serial number and the control type of the first target control, wherein the preset action comprises assignment, clicking, positioning and attribute value reading;
when the action type is that the two layers find sequence numbers according to labels, a father control is determined based on the Wen Zibiao signature of the first layer, the control type of the first layer and the searching direction of the control type of the first layer, the global sequence number of a second target control is determined based on the Wen Zibiao signature of the second layer, the control type of the second layer and the searching direction of the control type of the second layer, and a preset action is executed on the second target control based on the global sequence number, wherein the preset action comprises assignment, clicking, positioning and attribute value reading;
When the action type is the frame, determining a global sequence number of a third target control based on the frame name, the control type and the sequence number of the control type, and executing a preset action on the third target control based on the global sequence number, wherein the preset action comprises assignment, clicking, positioning and attribute value reading;
and when the action type is the simulated key, executing an action corresponding to a key position code of the keyboard.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, the device includes one or more processors (CPUs), memory, and a bus. The device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.
Claims (8)
1. The automatic filling method of the webpage form is characterized by comprising the steps of based on a configuration template, wherein the configuration template at least comprises an action type and parameters corresponding to the action type, the action type is used for executing corresponding target actions based on the parameters, the action type comprises an activation IE, a single layer of serial numbers according to labels, two layers of serial numbers according to labels, a frame and a simulation key, and the automatic filling method of the webpage form comprises the following steps:
determining a target action type of a webpage form to be filled in;
obtaining target parameters corresponding to the target action types, wherein the target parameters at least comprise one or more of a storage website, a text label, a control type, a search radius of the control type, a search direction of the control type, a search range of the control type, a frame name, a serial number of the control type and a key code of a keyboard;
based on the target parameters, executing webpage form filling actions corresponding to the target parameters;
wherein the obtaining the target parameter corresponding to the action type includes:
judging the target action type;
when the target action type is the starting IE, determining the storage website as the target parameter;
When the action type is that the single layer finds a sequence number according to a label, determining the Wen Zibiao signature, the control type, the searching radius of the control type, the searching direction of the control type and the searching range of the control type as the target parameters;
when the action type is that the two layers find sequence numbers according to labels, determining that a first layer of Wen Zibiao signature, a second layer of text label name, a first layer of control type, a second layer of control type, a search direction of the first layer of control type and a search direction of the second layer of control type are the target parameters;
when the action type is the frame, determining that the frame name, the control type and the serial number of the control type are the target parameters;
and when the action type is the simulated key, determining a key position code of the keyboard as the target parameter.
2. The automatic filling method of web forms according to claim 1, wherein the determining the target action type of the web form to be filled comprises:
obtaining html source codes of the webpage form to be filled in;
and determining the target action type of the webpage form to be filled in based on the html source code.
3. The automatic filling method of web forms according to claim 1, wherein the performing a web form filling action corresponding to the target parameter based on the target parameter comprises:
when the target action type is the starting IE, opening a browser based on the storage website;
when the action type is that the single layer finds a serial number according to a label, a first serial number of a label corresponding to the character label name in a structure body is determined based on the character label name, a global serial number of a first target control adjacent to the first serial number is determined based on the first serial number, a searching radius of the control type, a searching direction of the control type and a searching range of the control type, and a preset action is executed on the first target control based on the global serial number and the control type of the first target control, wherein the preset action comprises assignment, clicking, positioning and attribute value reading;
when the action type is that the two layers find sequence numbers according to labels, a father control is determined based on the Wen Zibiao signature of the first layer, the control type of the first layer and the searching direction of the control type of the first layer, the global sequence number of a second target control is determined based on the Wen Zibiao signature of the second layer, the control type of the second layer and the searching direction of the control type of the second layer, and a preset action is executed on the second target control based on the global sequence number, wherein the preset action comprises assignment, clicking, positioning and attribute value reading;
When the action type is the frame, determining a global sequence number of a third target control based on the frame name, the control type and the sequence number of the control type, and executing a preset action on the third target control based on the global sequence number, wherein the preset action comprises assignment, clicking, positioning and attribute value reading;
and when the action type is the simulated key, executing an action corresponding to a key position code of the keyboard.
4. The automatic filling device of the webpage form is characterized in that the automatic filling device of the webpage form at least comprises an action type and parameters corresponding to the action type based on a configuration template, wherein the action type is used for executing corresponding target actions based on the parameters, the action type comprises an activation IE, a single layer of serial numbers according to labels, two layers of serial numbers according to labels, a frame and a simulation key, and the automatic filling device of the webpage form comprises:
the determining module is used for determining the target action type of the webpage form to be filled in;
the acquisition module is used for acquiring target parameters corresponding to the target action types, wherein the target parameters at least comprise one or more of a storage website, a text label, a control type, a search radius of the control type, a search direction of the control type, a search range of the control type, a frame name, a serial number of the control type and a key code of a keyboard;
The execution module is used for executing the webpage form filling action corresponding to the target parameter based on the target parameter;
wherein, the acquisition module includes:
the judging unit is used for judging the target action type;
the second determining unit is configured to determine that the storage website is the target parameter when the target action type is the start IE;
the third determining unit is configured to determine, when the action type is that the single layer finds a sequence number according to a label, that the Wen Zibiao signature, the control type, a search radius of the control type, a search direction of the control type, and a search range of the control type are the target parameters;
a fourth determining unit, configured to determine, when the action type is the two layers of search numbers according to labels, that a first layer of the Wen Zibiao signature, a second layer of the text label name, a first layer of the control type, a second layer of the control type, a search direction of the first layer of the control type, and a search direction of the second layer of the control type are the target parameters;
a fifth determining unit, configured to determine, when the action type is the frame, that the frame name, the control type, and a sequence number of the control type are the target parameters;
And a sixth determining unit, configured to determine, when the action type is the simulated key, that a key position code of the keyboard is the target parameter.
5. The web form auto-fill device of claim 4, wherein the determination module comprises:
the acquisition unit is used for acquiring html source codes of the webpage form to be filled in;
the first determining unit is used for determining the target action type of the webpage form to be filled in based on the html source code.
6. The web form auto-fill device of claim 4, wherein the execution module comprises:
the first execution unit is used for opening a browser based on the storage website when the target action type is the starting IE;
the second execution unit is used for determining a first serial number of a label corresponding to the text label name in a structure body based on the text label name when the action type is that the single layer finds the serial number according to the label, determining a global serial number of a first target control adjacent to the first serial number based on the first serial number, a search radius of the control type, a search direction of the control type and a search range of the control type, and executing preset actions on the first target control based on the global serial number and the control type of the first target control, wherein the preset actions comprise assignment, clicking, positioning and attribute value reading;
The third execution unit is used for determining a parent control based on the Wen Zibiao signature of the first layer, the control type of the first layer and the searching direction of the control type of the first layer when the action type is the sequence number of the two layers according to the label, determining the global sequence number of the second target control based on the Wen Zibiao signature of the second layer, the control type of the second layer and the searching direction of the control type of the second layer, and executing preset actions on the second target control based on the global sequence number, wherein the preset actions comprise assignment, clicking, positioning and attribute value reading;
the fourth execution unit is used for determining the global sequence number of the third target control based on the frame name, the control type and the sequence number of the control type when the action type is the frame, and executing a preset action on the third target control based on the global sequence number, wherein the preset action comprises assignment, clicking, positioning and attribute value reading;
and the fifth execution unit is used for executing the action corresponding to the key position code of the keyboard when the action type is the analog key.
7. A storage medium comprising a stored program, wherein the program, when run, controls a device in which the storage medium is located to perform the automatic form filling method of any one of claims 1 to 3.
8. An electronic device comprising at least one processor, and at least one memory, bus, connected to the processor; the processor and the memory complete communication with each other through the bus; the processor is configured to invoke program instructions in the memory to perform the automatic form filling method according to any of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911422246.7A CN111177633B (en) | 2019-12-31 | 2019-12-31 | Automatic filling method and device for web form, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911422246.7A CN111177633B (en) | 2019-12-31 | 2019-12-31 | Automatic filling method and device for web form, storage medium and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111177633A CN111177633A (en) | 2020-05-19 |
CN111177633B true CN111177633B (en) | 2023-10-20 |
Family
ID=70650671
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911422246.7A Active CN111177633B (en) | 2019-12-31 | 2019-12-31 | Automatic filling method and device for web form, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111177633B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6589290B1 (en) * | 1999-10-29 | 2003-07-08 | America Online, Inc. | Method and apparatus for populating a form with data |
CN102201009A (en) * | 2011-06-21 | 2011-09-28 | 深圳市凯立德科技股份有限公司 | Form generating method and device |
CN102460428A (en) * | 2009-06-05 | 2012-05-16 | 惠普开发有限公司 | Systems and methods for representing user interactions with web services |
CN109460546A (en) * | 2018-11-09 | 2019-03-12 | 腾讯科技(深圳)有限公司 | List generation method, device and electronic equipment |
-
2019
- 2019-12-31 CN CN201911422246.7A patent/CN111177633B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6589290B1 (en) * | 1999-10-29 | 2003-07-08 | America Online, Inc. | Method and apparatus for populating a form with data |
CN102460428A (en) * | 2009-06-05 | 2012-05-16 | 惠普开发有限公司 | Systems and methods for representing user interactions with web services |
CN102201009A (en) * | 2011-06-21 | 2011-09-28 | 深圳市凯立德科技股份有限公司 | Form generating method and device |
CN109460546A (en) * | 2018-11-09 | 2019-03-12 | 腾讯科技(深圳)有限公司 | List generation method, device and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN111177633A (en) | 2020-05-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108156022B (en) | Service calling method and device and electronic equipment | |
US20180278494A1 (en) | Automated constructing method of cloud manufacturing service and cloud manufacturing system | |
US9454535B2 (en) | Topical mapping | |
CN106354483B (en) | Data processing method and device and electronic equipment | |
CN109460546A (en) | List generation method, device and electronic equipment | |
CN115794437B (en) | Microservice calling method, device, computer equipment and storage medium | |
CN118536119B (en) | Smart contract vulnerability detection method, device, equipment and medium | |
US10248392B2 (en) | Replicating a web technology | |
Altinbas et al. | GUI element detection from mobile UI images using YOLOv5 | |
CN115687075A (en) | Error correction method and device for page test script | |
CN113392014A (en) | Test case generation method and device, electronic equipment and medium | |
CN111079392B (en) | Automatic filling method and device for web form, storage medium and electronic equipment | |
CN111177633B (en) | Automatic filling method and device for web form, storage medium and electronic equipment | |
CN109933528A (en) | A kind of method and device of automatized script encapsulation | |
CN110955813A (en) | Data crawling method and device | |
CN111159994B (en) | Automatic filling method and device for web form, storage medium and electronic equipment | |
US8930960B2 (en) | Methods and systems for object interpretation within a shared object space | |
CN115297042B (en) | Method for detecting consistency of webpages under different networks and related equipment | |
Stroulia et al. | Reverse engineering interaction plans for legacy interface migration | |
EP4303719B1 (en) | Automated generation of web applications based on wireframe metadata generated from user requirements | |
CN111176692A (en) | Data updating method and electronic equipment | |
CN119336408B (en) | Interface configuration method, device and storage medium | |
US12154356B2 (en) | Automated key-value pair extraction | |
CN115098090B (en) | Form generation method and device | |
CN110968758B (en) | Webpage data crawling method and device |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |