CN103646081B - Method and device for logging in web page - Google Patents
Method and device for logging in web page Download PDFInfo
- Publication number
- CN103646081B CN103646081B CN201310682992.6A CN201310682992A CN103646081B CN 103646081 B CN103646081 B CN 103646081B CN 201310682992 A CN201310682992 A CN 201310682992A CN 103646081 B CN103646081 B CN 103646081B
- Authority
- CN
- China
- Prior art keywords
- login
- label
- target webpage
- module
- information
- 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; CALCULATING OR 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/08—Protocols specially adapted for terminal emulation, e.g. Telnet
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Mining & Analysis (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明公开了一种在网页中进行登录的方法和装置,所述方法包括:主进程启动一个子进程,并向所述子进程发送当前要登录的目标网页信息;子进程获取所述目标网页标识对应的登录配置规则;子进程依据所述登录配置规则加载所述目标网页标识对应的目标网页;子进程对所述目标网页中的元素进行定位确定登录对象;将所述登录信息标识对应的登录信息填充到所述登录对象中;其中,所述子进程依据所述登录配置规则加载所述目标网页标识对应的目标网页,具体包括:加载所述目标网页标识对应的目标网页;判断所述登录配置规则中是否包括动态库拦截步骤,若包括,则拦截所述目标网页对应的动态链接库。相对于现有技术的填表登录方法,本发明实施例提供的登录方法能够让用户使用多个不同的账号、密码同时登录一个网站。
The invention discloses a method and device for logging in a web page. The method includes: a main process starts a sub-process, and sends the target web page information to be logged in to the sub-process; the sub-process acquires the target web page Identify the corresponding login configuration rule; the subprocess loads the target webpage corresponding to the target webpage identifier according to the login configuration rule; the subprocess locates the elements in the target webpage to determine the login object; identifies the corresponding login information The login information is filled into the login object; wherein, the subprocess loads the target webpage corresponding to the target webpage identifier according to the login configuration rule, specifically including: loading the target webpage corresponding to the target webpage identifier; judging that the Whether the dynamic library interception step is included in the login configuration rule, and if yes, the dynamic link library corresponding to the target webpage is intercepted. Compared with the log-in method of filling in a form in the prior art, the log-in method provided by the embodiment of the present invention enables a user to log in to a website simultaneously using multiple different account numbers and passwords.
Description
技术领域technical field
本发明涉及通信技术领域,具体涉及一种在网页中进行登录的方法和装置。The invention relates to the field of communication technology, in particular to a method and device for logging in a webpage.
背景技术Background technique
目前互联网技术已经深入影响人们的生活,诸如电子邮箱、论坛、网页游戏等也已成为人们日常工作和娱乐中不可或缺的一部分。但上述互联网应用大多需要用户注册并登录后才能使用,因此用户需要记忆大量的用户名和密码。为了帐号的安全,用户通常还需要设置较为复杂的数字、字母、特殊符号组合的密码,进一步加大了记忆的难度,在每次登录时还需要手工输入,这一切无疑对用户的使用造成了负担。网页自动填表就是解决这一问题的技术,它可以在保存用户在网页中输入的用户名和密码,在下一次用户打开相同网页时,自动帮用户填写已保存的用户名和密码,用户不必再记忆和填写大量的用户名和密码,使用各种网络资源和服务更加轻松随意。At present, Internet technology has profoundly affected people's lives, such as e-mail, forums, web games, etc., have also become an indispensable part of people's daily work and entertainment. However, most of the above Internet applications require users to register and log in before they can be used, so users need to memorize a large number of user names and passwords. For the security of the account, users usually need to set a password with a combination of numbers, letters, and special symbols, which further increases the difficulty of remembering, and needs to be manually input every time they log in. burden. Web page automatic filling is a technology to solve this problem. It can save the user name and password entered by the user in the web page, and automatically fill in the saved user name and password for the user when the user opens the same web page next time. Fill in a large number of user names and passwords, and use various network resources and services more easily and casually.
现有技术在使用浏览器对一个网站进行自动填表时,会将用户的登录账号、登录密码保存在客户端的Cookie中,当用户打开登录页面时,从Cookie信息中提取登录账号、密码填充到网页的输入框中。但是,现有的浏览器在用户登录后会将用户的登录信息保存在Web服务器的Session中,当用户使用另一账号、密码登录网站时,Web服务器认为本次请求来自同一浏览器客户端,并且将Session中之前的登录账号、密码注销后保存新的账号、密码,即同一时刻,仅允许用户使用一个账号、密码登录。In the prior art, when a browser is used to automatically fill in a form on a website, the user's login account and password will be stored in a cookie on the client. When the user opens the login page, the login account and password will be extracted from the cookie information and filled into the In the input box of the web page. However, existing browsers will save the user's login information in the Session of the Web server after the user logs in. When the user logs in to the website with another account number and password, the Web server thinks that this request comes from the same browser client. And save the new account and password after logging out the previous login account and password in the Session, that is, at the same time, only allow the user to log in with one account and password.
发明内容Contents of the invention
鉴于上述问题,本发明提供一种克服上述问题或者至少部分地解决上述问题的一种网页中进行登录的方法和装置。In view of the above problems, the present invention provides a method and device for logging in a webpage to overcome the above problems or at least partially solve the above problems.
依据本发明的一个方面,提供了一种网页中进行登录的方法,包括:According to one aspect of the present invention, a method for logging in a webpage is provided, including:
主进程启动一个子进程,并向所述子进程发送当前要登录的目标网页信息,所述目标网页信息包括目标网页标识、登录信息标识;The main process starts a sub-process, and sends the current target webpage information to be logged in to the sub-process, and the target webpage information includes a target webpage identifier and a login information identifier;
子进程获取所述目标网页标识对应的登录配置规则;The sub-process obtains the login configuration rule corresponding to the target web page identifier;
子进程依据所述登录配置规则加载所述目标网页标识对应的目标网页;The subprocess loads the target webpage corresponding to the target webpage identifier according to the login configuration rule;
子进程对所述目标网页中的元素进行定位确定登录对象;The subprocess locates the elements in the target webpage to determine the login object;
将对应的登录信息填充到所述登录对象中,所述登录信息包括登录账号信息和/或登录密码信息;filling the corresponding login information into the login object, the login information including login account information and/or login password information;
其中,所述子进程依据所述登录配置规则加载所述目标网页标识对应的目标网页,具体包括:Wherein, the sub-process loads the target webpage corresponding to the target webpage identifier according to the login configuration rule, specifically including:
加载所述目标网页标识对应的目标网页;Loading the target webpage corresponding to the target webpage identifier;
判断所述登录配置规则中是否包括动态库拦截步骤,若包括,则拦截所述目标网页对应的动态链接库。It is judged whether the dynamic library interception step is included in the login configuration rule, and if yes, the dynamic link library corresponding to the target web page is intercepted.
可选地,所述子进程依据所述登录配置规则加载所述目标网页标识对应的目标网页,还包括:Optionally, the subprocess loads the target webpage corresponding to the target webpage identifier according to the login configuration rule, and further includes:
判断所述登录配置规则中是否包括前置步骤,若包括,则按照所述登录配置规则执行所述前置步骤。Judging whether the login configuration rule includes a pre-step, and if so, executing the pre-step according to the login configuration rule.
可选地,Optionally,
所述按照所述登录配置规则执行前置步骤,具体包括:The performing the pre-steps according to the login configuration rules specifically includes:
加载所述前置步骤中预设的前置URL和/或执行所述前置步骤中预设的JavaScript脚本。Loading the pre-preset URL in the pre-step and/or executing the pre-set JavaScript script in the pre-step.
可选地,所述将对应的登录信息填充到所述登录对象中具体包括:Optionally, the filling the corresponding login information into the login object specifically includes:
子进程判断所述登录配置规则中是否包括密码输入控制,若包括,则依据所述登录配置规则向所述登录对象中填充登录账号信息;依据所述登录配置规则中的密码输入控制信息向所述登录对象中填充登录密码,所述密码输入控制信息包括密码输入时间间隔。The subprocess judges whether password input control is included in the login configuration rule, and if so, fills the login account information into the login object according to the login configuration rule; The login object is filled with a login password, and the password input control information includes a password input time interval.
可选地,所述子进程获取所述目标网页标识对应的登录配置规则,具体包括:Optionally, the sub-process obtains the login configuration rule corresponding to the target web page identifier, specifically including:
子进程根据当前要访问的网页信息中的登录URL匹配第一配置表,所述第一配置表中包括网页URL类别和对应的第二配置表标识;The subprocess matches the first configuration table according to the login URL in the web page information to be accessed currently, and the first configuration table includes a web page URL category and a corresponding second configuration table identification;
子进程根据匹配出的第二配置表标识从第二配置表中获取对应的登录配置规则。The sub-process obtains the corresponding login configuration rule from the second configuration table according to the matched second configuration table identifier.
可选地,所述方法还包括:Optionally, the method also includes:
子进程判断所述网页中的登录对象是否包括登录按钮,若包括,则对所述登录按钮执行点击操作。The sub-process judges whether the login object in the web page includes a login button, and if so, performs a click operation on the login button.
可选地,所述对登录按钮执行点击操作之前,还包括:Optionally, before performing the click operation on the login button, it also includes:
判断所述网页中的登录对象是否包括校验码输入框,若包括,则所述方法终止。It is judged whether the login object in the web page includes a verification code input box, and if so, the method is terminated.
可选地,所述对所述登录按钮执行点击操作之后还包括:Optionally, after performing the click operation on the login button, the method further includes:
判断所述登录配置规则中是否包括后置步骤,若包括,则按照所述登录配置规则执行所述后置步骤。It is judged whether the post-step is included in the login configuration rule, and if yes, the post-step is executed according to the login configuration rule.
可选地,Optionally,
所述按照所述登录配置规则执行所述后置步骤,具体包括:The performing the post steps according to the login configuration rules specifically includes:
加载所述后置步骤中预设的后置URL和/或执行所述后置步骤中预设的JavaScript脚本。Loading the preset post URL in the post step and/or executing the preset JavaScript script in the post step.
可选地,所述对所述目标网页中的元素进行定位确定登录对象,具体包括:Optionally, the locating the elements in the target webpage to determine the login object specifically includes:
获取目标网页中的全部标签对象生成标签集合;Obtain all label objects in the target web page to generate a label collection;
根据所述标签集合中标签对象的公共属性,对所述标签对象进行分组,从所述分组的结果获得一个或多个分组标签;group the tag objects according to the common attributes of the tag objects in the tag set, and obtain one or more group tags from the grouping result;
依据预置的标记文件解析映射表,匹配所述一个或多个分组标签中的标签对象的属性;Parse the mapping table according to the preset tag file, and match the attributes of the tag objects in the one or more group tags;
确定相匹配的分组标签为登录对象。Determine the matching group label as the login object.
可选地,根据所述标签集合中标签对象的公共属性对所述标签对象进行分组,包括:Optionally, grouping the label objects according to the common attributes of the label objects in the label collection includes:
将标签集合中具有相同父节点的标签对象置于同一分组标签内。Place label objects with the same parent node in the label collection into the same grouping label.
可选地,所述从所述分组的结果获得一个或多个分组标签之后还包括:Optionally, after obtaining one or more grouping labels from the grouping result, it also includes:
分组标签再分组,具体包括:Grouping tags are grouped again, including:
判断当前分组结果中一个或多个分组标签;Determine one or more grouping labels in the current grouping result;
若当前分组标签包含两个或多个标签对象,且所述两个或多个标签对象不具有相同的父节点,则将当前分组标签内具有相同父节点的标签对象置于另一分组标签内;If the current group label contains two or more label objects, and the two or more label objects do not have the same parent node, put the label objects with the same parent node in the current group label into another group label ;
重复上述步骤直到当前分组标签不可再分组。Repeat the above steps until the current group label can no longer be grouped.
可选地,所述标签对象是<input>输入框;Optionally, the label object is an <input> input box;
所述依据预置的标记文件解析映射表,匹配所述一个或多个分组标签中的标签对象的属性还包括:The parsing the mapping table according to the preset tag file, and matching the attributes of the tag objects in the one or more group tags also includes:
若当前分组标签中仅含有1个密码输入框,且位于所述密码输入框下级兄弟节点的标签对象不是文本输入框,则当前分组标签为登录表单;If there is only one password input box in the current group label, and the label object located in the sibling node of the password input box is not a text input box, then the current group label is a login form;
所述确定相匹配的分组标签为登录对象,具体包括:The determination that the matching group label is the login object specifically includes:
所述登录表单的元素为登录对象;所述登录表单中的文本输入框为登录账号输入框,所述登录表单中的密码输入框为登录密码输入框。The element of the login form is a login object; the text input box in the login form is a login account input box, and the password input box in the login form is a login password input box.
可选地,所述子进程对所述目标网页中的元素进行定位确定登录对象之前,还包括:Optionally, before the subprocess locates the elements in the target webpage and determines the login object, it also includes:
将登录流程标识设置为开始;Set the login flow ID to start;
所述将对应的登录信息填充到所述登录对象中之后,还包括:After filling the corresponding login information into the login object, it also includes:
将登录流程标识设置为结束。Set the sign-in process flag to end.
依据本发明的另一方面,还提供了一种在网页中进行登录的装置,包括:主进程模块、子进程模块;According to another aspect of the present invention, a device for logging in a webpage is also provided, including: a main process module and a subprocess module;
所述主进程模块包括:The main process module includes:
子进程启动模块,用于启动一个子进程,并向所述子进程发送当前要登录的目标网页信息,所述目标网页信息包括目标网页标识、登录信息标识;The sub-process starting module is used to start a sub-process, and send the current target webpage information to be logged in to the sub-process, and the target webpage information includes a target webpage identifier and a login information identifier;
所述子进程模块包括:The subprocess module includes:
登录配置规则获取模块,用于获取目标网页标识对应的登录配置规则;A login configuration rule obtaining module, configured to obtain a login configuration rule corresponding to the target web page identifier;
网页加载模块,用于依据所述登录配置规则加载所述目标网页标识对应的网页;A webpage loading module, configured to load a webpage corresponding to the target webpage identifier according to the login configuration rule;
登录对象确定模块,用于对所述目标网页中的元素进行定位确定登录对象;A login object determination module, configured to locate elements in the target webpage to determine a login object;
登录信息填充模块,用于将所述登录信息标识对应的登录信息填充到所述登录对象中,所诉登录信息包括登录账号信息和/或登录密码信息;A login information filling module, configured to fill the login information corresponding to the login information identifier into the login object, where the login information includes login account information and/or login password information;
其中,所述网页加载模块,具体用于加载所述目标网页标识对应的目标网页;判断所述登录配置规则中是否包括动态库拦截步骤,若包括,则拦截所述目标网页对应的动态链接库。Wherein, the webpage loading module is specifically used to load the target webpage corresponding to the target webpage identifier; determine whether the login configuration rule includes a dynamic library interception step, and if so, intercept the dynamic link library corresponding to the target webpage .
可选地,Optionally,
所述网页加载模块,具体还用于判断所述登录配置规则中是否包括前置步骤,若包括,按照所述登录配置规则执行所述前置步骤。The webpage loading module is specifically further configured to determine whether the login configuration rule includes a pre-step, and if so, execute the pre-step according to the login configuration rule.
可选地,Optionally,
所述网页加载模块,具体还用于加载所述前置步骤中预设的前置URL和/或执行所述前置步骤中预设的JavaScript脚本。The webpage loading module is specifically further configured to load the preset URL in the preceding step and/or execute the JavaScript script preset in the preceding step.
可选地,Optionally,
所述登录信息填充模块,具体用于判断所述登录配置规则中是否包括密码输入控制,若包括,则依据所述登录配置规则向所述登录对象中填充登录账号信息;依据所述登录配置规则中的密码输入控制信息向所述登录对象中填充登录密码,所述密码输入控制信息包括密码输入时间间隔。The login information filling module is specifically used to judge whether the password input control is included in the login configuration rules, and if so, fill the login account information into the login object according to the login configuration rules; The password input control information in fills the login object with a login password, and the password input control information includes a password input time interval.
可选地,Optionally,
所述登录配置规则获取模块,具体用于根据当前要访问的网页信息中的登录URL匹配第一配置表,所述第一配置表中包括网页URL类别和对应的第二配置表标识;根据匹配出的第二配置表标识从第二配置表中获取对应的登录配置规则。The login configuration rule acquisition module is specifically used to match the first configuration table according to the login URL in the webpage information to be accessed currently, and the first configuration table includes the web page URL category and the corresponding second configuration table identifier; according to the matching The obtained second configuration table identifier obtains the corresponding login configuration rule from the second configuration table.
可选地,所述子进程模块还包括:Optionally, the subprocess module also includes:
按钮点击模块,用于判断所述网页中的登录对象是否包括登录按钮,若包括,则对所述登录按钮执行点击操作。The button clicking module is used for judging whether the login object in the web page includes a login button, and if yes, performs a click operation on the login button.
可选地,所述子进程模块,还包括:Optionally, the subprocess module also includes:
校验输入模块,用于判断所述网页中的登录对象是否包校验码输入框,若包括,则结束当前操作。The verification input module is used for judging whether the login object in the webpage includes a verification code input box, and if so, ends the current operation.
可选地,所述子进程模块,还包括:Optionally, the subprocess module also includes:
后置步骤模块,用于判断所述登录配置规则中是否包括后置步骤,若包括,按照所述登录配置规则执行所述后置步骤。The post-step module is used to judge whether the post-step is included in the login configuration rule, and if so, execute the post-step according to the login configuration rule.
可选地,所述后置步骤模块,具体用于:加载所述后置步骤中预设的后置URL和/或执行所述后置步骤中预设的JavaScript脚本。Optionally, the post-step module is specifically configured to: load a pre-set post URL in the post-step and/or execute a preset JavaScript script in the post-step.
可选地,所述登录对象确定模块,具体用于:Optionally, the login object determination module is specifically used for:
获取网页中的全部标签对象生成标签集合;Get all label objects in the web page to generate a label collection;
根据所述标签集合中标签对象的公共属性,对所述标签对象进行分组,从所述分组的结果获得一个或多个分组标签;group the tag objects according to the common attributes of the tag objects in the tag set, and obtain one or more group tags from the grouping result;
依据预置的标记文件解析映射表,匹配所述一个或多个分组标签中的标签对象的属性;Parse the mapping table according to the preset tag file, and match the attributes of the tag objects in the one or more group tags;
确定相匹配的分组标签为登录对象。Determine the matching group label as the login object.
可选地,所述登录对象确定模块根据所述标签集合中标签对象的公共属性对所述标签对象进行分组,具体包括:将标签集合中具有相同父节点的标签对象置于同一分组标签内。Optionally, the login object determination module groups the label objects according to the common attributes of the label objects in the label set, specifically including: placing label objects in the label set with the same parent node in the same grouping label.
可选地,所述登录对象确定模块还用于:Optionally, the login object determination module is also used for:
分组标签再分组,具体包括:Grouping tags are grouped again, including:
判断当前分组结果中一个或多个分组标签;Determine one or more grouping labels in the current grouping result;
若当前分组标签包含两个或多个标签对象,且所述两个或多个标签对象不具有相同的父节点,则将当前分组标签内具有相同父节点的标签对象置于另一分组标签内;If the current group label contains two or more label objects, and the two or more label objects do not have the same parent node, put the label objects with the same parent node in the current group label into another group label ;
重复上述步骤直到当前分组标签不可再分组。Repeat the above steps until the current group label can no longer be grouped.
可选地,所述标签对象是<input>输入框;Optionally, the label object is an <input> input box;
所述登录对象确定模块依据预置的标记文件解析映射表,匹配所述一个或多个分组标签中的标签对象的属性还用于:The login object determination module parses the mapping table according to the preset tag file, matches the attributes of the tag objects in the one or more group tags and is also used for:
若当前分组标签中仅含有1个密码输入框,且位于所述密码输入框下级兄弟节点的标签对象不是文本输入框,则当前分组标签为登录表单;If there is only one password input box in the current group label, and the label object located in the sibling node of the password input box is not a text input box, then the current group label is a login form;
所述登录对象确定模块确定相匹配的分组标签为登录对象,具体用于:The login object determining module determines that the matching grouping label is a login object, specifically for:
所述登录表单的元素为登录对象;所述登录表单中的文本输入框为登录账号输入框,所述登录表单中的密码输入框为登录密码输入框。The element of the login form is a login object; the text input box in the login form is a login account input box, and the password input box in the login form is a login password input box.
可选地,所述子进程模块还包括:Optionally, the subprocess module also includes:
登录流程状态标记模块,用于对所述网页中的登录对象进行定位之前,将登录流程标识设置为开始;以及在将对应的登录信息填充到所述登录对象中之后,将登录流程标识设置为结束。The login process status marking module is used to set the login process identifier to start before locating the login object in the web page; and after filling the corresponding login information into the login object, set the login process identifier to Finish.
本发明实施例提供的技术方案至少带来以下技术效果:The technical solutions provided by the embodiments of the present invention bring at least the following technical effects:
现有技术在使用浏览器客户端对一个网站进行登录时,会将当前的登录账号、登录密码保存在Web服务器的Session中,当用户使用另一账号、密码登录网站时,由于服务器认为当前登录请求来自同一浏览器客户端,因此会将Session中之前的登录账号、密码注销后并存储新的账号和密码,即同一时刻,对于一个客户端,仅允许用户使用一个账号、密码登录。本发明实施例中,主进程针对同一个网站的不同登录请求启动对应的多个子进程,每个子进程在其各自对应的子窗口中分别加载登录页面,在子窗口中的登录页面中允许使用不同的登录账号、登录密码对同一网站进行登录,每个子进程独立地向Web服务器发送登录请求,Web服务器认为来自不同子进程的登录请求是不同的浏览器客户端,会分别在Session中存储各子进程对应的登录账号、登录密码,实现对同一网站的多账号同时登录。In the prior art, when using a browser client to log in to a website, the current login account number and login password will be saved in the session of the web server. The request comes from the same browser client, so the previous login account and password in the Session will be canceled and the new account and password will be stored, that is, at the same time, for one client, the user is only allowed to log in with one account and password. In the embodiment of the present invention, the main process starts a plurality of corresponding sub-processes for different login requests of the same website, and each sub-process loads a login page in its respective sub-window, and different login pages are allowed to be used in the sub-window. login account and password to log in to the same website, and each sub-process sends a login request to the web server independently, and the web server considers that the login requests from different sub-processes are different browser clients, and stores each sub-process in the Session respectively. The login account and login password corresponding to the process can realize the simultaneous login of multiple accounts on the same website.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:
图1示出了根据本发明一个实施例的一种网页中进行登录的方法的步骤流程图;FIG. 1 shows a flowchart of steps of a method for logging in a webpage according to an embodiment of the present invention;
图2示出了根据本发明一个实施例的一种网页中进行登录的方法的步骤流程图;FIG. 2 shows a flowchart of steps of a method for logging in a webpage according to an embodiment of the present invention;
图3示出了根据本发明一个实施例的一种网页中进行登录的方法中确定网页中登录对象的方法的步骤流程图;FIG. 3 shows a flow chart of steps of a method for determining a login object in a webpage in a method for logging in a webpage according to an embodiment of the present invention;
图4示出了根据本发明一个实施例的一种网页中进行登录的装置的结构示意图。Fig. 4 shows a schematic structural diagram of an apparatus for logging in a webpage according to an embodiment of the present invention.
具体实施方式detailed description
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
实施例一Embodiment one
参照图1,图1示出了本发明实施例提供的一种网页中进行登录的方法,所述方法包括:Referring to FIG. 1, FIG. 1 shows a method for logging in a webpage provided by an embodiment of the present invention, the method comprising:
S101,主进程启动一个子进程,并向所述子进程发送当前要登录的目标网页信息,所述目标网页信息包括目标网页标识、登录信息标识。S101, the main process starts a sub-process, and sends the target webpage information to be logged in to the sub-process, and the target webpage information includes a target webpage identifier and a login information identifier.
本发明实施例中,主进程根据用户发出的登录请求启动对应的子进程,每个子进程根据接收到的目标网页标识在其对应的浏览器子窗口中加载所述目标网页标识对应的网页,该网页中包括用于登录的登录对象,例如:用户名输入框、密码输入框、登录按钮等。对所述各个浏览器子窗口,可使用不同的登录信息在所述浏览器子窗口中进行登录操作,所述登录信息包括登录账号和/或登录密码。In the embodiment of the present invention, the main process starts the corresponding sub-process according to the login request sent by the user, and each sub-process loads the webpage corresponding to the target webpage identifier in its corresponding browser sub-window according to the received target webpage identifier. The web page includes login objects for login, such as: user name input box, password input box, login button, etc. For each of the browser sub-windows, different login information can be used to perform login operations in the browser sub-windows, and the login information includes a login account and/or a login password.
其中,目标网页信息中的目标网页标识用于唯一标识一个网页,一般而言,其可以是网页URL,另外也可以是按一定规则设定的标识信息,本发明对此不作具体限制。Wherein, the target webpage identifier in the target webpage information is used to uniquely identify a webpage. Generally speaking, it can be a webpage URL, or it can also be identification information set according to certain rules, which is not specifically limited in the present invention.
其中,登录信息标识对应登录信息,包括:登录账号、登录密码等。Wherein, the login information identifier corresponds to the login information, including: a login account, a login password, and the like.
S102,子进程获取所述目标网页标识对应的登录配置规则。S102, the sub-process obtains the login configuration rule corresponding to the target webpage identifier.
其中,所述登录配置规则具体包括:前置步骤和/或动态库拦截步骤和/或密码输入控制和/或后置步骤。Wherein, the login configuration rule specifically includes: a pre-step and/or a dynamic library interception step and/or password input control and/or a post-step.
进一步的,所述前置步骤具体包括:加载所述前置步骤中预设的前置URL和/或执行所述前置步骤中预设的JavaScript脚本。Further, the preceding step specifically includes: loading the preset URL in the preceding step and/or executing the JavaScript script preset in the preceding step.
进一步的,所述后置步骤具体包括:加载所述后置步骤中预设的后置URL和/或执行所述后置步骤中预设的JavaScript脚本。Further, the post-step specifically includes: loading the preset post-URL in the post-step and/or executing the preset JavaScript script in the post-step.
对于不同网页的登录操作,其设置的登录步骤流程可能不同,本发明实施例按照网页中对登录对象的具体操作流程确定并存储对应的登录配置规则。For the login operations of different webpages, the set login steps may be different, and the embodiment of the present invention determines and stores the corresponding login configuration rules according to the specific operation procedures of the login objects in the webpage.
本领域技术人员应当理解,所述登录配置规则还可包括与所述网页登录操作对应的其他操作流程和动作,或者由本领域技术人员根据网页登录时的实际需要确定的其他配置规则,本发明对登录配置规则的内容不作具体限制。Those skilled in the art should understand that the login configuration rules may also include other operation procedures and actions corresponding to the webpage login operation, or other configuration rules determined by those skilled in the art according to the actual needs of webpage login. The content of the login configuration rule is not specifically limited.
S103,子进程依据所述登录配置规则加载所述目标网页标识对应的网页。S103, the subprocess loads the webpage corresponding to the target webpage identifier according to the login configuration rule.
其中,子进程依据所述登录配置规则加载所述目标网页标识对应的网页具体包括:Wherein, the sub-process loads the webpage corresponding to the target webpage identifier according to the login configuration rule specifically includes:
加载所述目标网页标识对应的目标网页;Loading the target webpage corresponding to the target webpage identifier;
判断所述登录配置规则中是否包括动态库拦截步骤,若包括,则拦截所述目标网页对应的动态链接库。It is judged whether the dynamic library interception step is included in the login configuration rule, and if yes, the dynamic link library corresponding to the target web page is intercepted.
进一步的,所述加载所述目标网页标识对应的目标网页之前,还包括:子进程判断所述登录配置规则中是否包括前置步骤,若包括,按照所述登录配置规则执行所述前置步骤。其中,所述按照所述登录配置规则执行前置步骤,具体包括:加载所述前置步骤中预设的前置URL和/或执行所述前置步骤中预设的JavaScript脚本。Further, before loading the target webpage corresponding to the target webpage identifier, it also includes: the sub-process judges whether the login configuration rule includes a pre-step, and if so, executes the pre-step according to the login configuration rule . Wherein, the performing the pre-step according to the login configuration rule specifically includes: loading the pre-preset URL in the pre-step and/or executing the JavaScript script preset in the pre-step.
S104,子进程对所述目标网页中的元素进行定位确定登录对象。S104, the subprocess locates elements in the target webpage to determine a login object.
其中,定位确定登录对象即定位网页中登录账号输入框、登录密码输入框、校验码输入框、登录按钮或其它登录对象在网页中的具体位置。Wherein, locating and determining the login object refers to locating the specific positions of the login account input box, login password input box, verification code input box, login button or other login objects in the webpage.
S105,将登录信息标识对应的登录信息填充到所述登录对象中,所诉登录信息包括登录账号信息和/或登录密码信息。S105. Fill the login object with the login information corresponding to the login information identifier, where the login information includes login account information and/or login password information.
现有技术在使用浏览器客户端对一个网站进行登录时,会将当前的登录账号、登录密码保存在Web服务器的Session中,当用户使用另一账号、密码登录网站时,由于服务器认为当前登录请求来自同一浏览器客户端,因此会将Session中之前的登录账号、密码注销后并存储新的账号和密码,即同一时刻,对于一个客户端,仅允许用户使用一个账号、密码登录。本发明实施例中,主进程针对同一个网站的不同登录请求启动对应的多个子进程,每个子进程在其各自对应的子窗口中分别加载登录页面,在子窗口中的登录页面中允许使用不同的登录账号、登录密码对同一网站进行登录,每个子进程独立地向Web服务器发送登录请求,Web服务器认为来自不同子进程的登录请求是不同的浏览器客户端,会分别在Session中存储各子进程对应的登录账号、登录密码,实现对同一网站的多账号同时登录。In the prior art, when using a browser client to log in to a website, the current login account number and login password will be saved in the session of the web server. The request comes from the same browser client, so the previous login account and password in the Session will be canceled and the new account and password will be stored, that is, at the same time, for one client, the user is only allowed to log in with one account and password. In the embodiment of the present invention, the main process starts a plurality of corresponding sub-processes for different login requests of the same website, and each sub-process loads a login page in its respective sub-window, and different login pages are allowed to be used in the sub-window. login account and password to log in to the same website, and each sub-process sends a login request to the web server independently, and the web server considers that the login requests from different sub-processes are different browser clients, and stores each sub-process in the Session respectively. The login account and login password corresponding to the process can realize the simultaneous login of multiple accounts on the same website.
其次,本发明实施根据不同网站的登录流程设置登录配置规则,并依据该配置规则加载对应的网页,使得该网页的加载过程完全映射用户对所述网页的登录操作,即使该网页设置有前置步骤等特殊操作,也能保证该网页的正常有效加载。尤其是,在加载目标网页的同时,判断所述登录配置规则中是否包括动态库拦截步骤,若包括,则拦截所述目标网页对应的动态链接库。Secondly, according to the implementation of the present invention, the login configuration rules are set according to the login processes of different websites, and the corresponding webpage is loaded according to the configuration rules, so that the loading process of the webpage completely maps the user’s login operation on the webpage, even if the webpage is set with a pre-set Steps and other special operations can also ensure the normal and effective loading of the web page. In particular, when the target web page is loaded, it is judged whether the login configuration rule includes the dynamic library interception step, and if so, the dynamic link library corresponding to the target web page is intercepted.
网页中的动态链接库常常会限制网页中输入框的正常输入,例如,当用户输入密码时弹出提示窗口,要求用户在该提示窗口中输入密码,因此,本发明实施例在目标网页加载时拦截需要加载的动态链接库,消除动态连接库对登录操作的影响。The dynamic link library in the web page often limits the normal input of the input box in the web page. For example, when the user enters the password, a prompt window pops up, requiring the user to enter the password in the prompt window. Therefore, the embodiment of the present invention intercepts the The dynamic link library that needs to be loaded eliminates the impact of the dynamic link library on the login operation.
进一步的,通过定位网页中的登录对象,将用户的登录账号、登录密码快速地填充到登录对象中,避免了系统因等待用户输入登录信息所耗费的时间,降低了系统的资源消耗。Furthermore, by locating the login object in the web page, the user's login account number and login password are quickly filled into the login object, which avoids the time spent by the system waiting for the user to input login information, and reduces the resource consumption of the system.
实施例二Embodiment two
参照图2,图2示出了本发明实施例提供的一种网页中进行登录的方法,所述方法包括:Referring to FIG. 2, FIG. 2 shows a method for logging in a webpage provided by an embodiment of the present invention, the method comprising:
S201,主进程启动一个子进程,并向所述子进程发送当前要登录的目标网页信息,所述目标网页信息包括目标网页标识、登录信息标识。S201, the main process starts a sub-process, and sends the target webpage information to be logged in to the sub-process, and the target webpage information includes a target webpage identifier and a login information identifier.
S202,子进程获取所述目标网页标识对应的登录配置规则。S202, the subprocess obtains the login configuration rule corresponding to the target webpage identifier.
进一步的,本步骤具体包括:Further, this step specifically includes:
主进程根据当前要访问的网页信息中的登录URL匹配第一配置表,所述第一配置表中包括网页URL类别和对应的第二配置表标识;The main process matches the first configuration table according to the login URL in the webpage information to be accessed currently, and the first configuration table includes the web page URL category and the corresponding second configuration table identification;
根据匹配出的第二配置表标识从第二配置表中获取对应的登录配置规则。The corresponding login configuration rule is obtained from the second configuration table according to the matched second configuration table identifier.
其中,第二配置表存储的与所述目标网页标识匹配的登录配置规则具体记录了该目标网页标识所在网页的登录操作流程,例如:是否需要执行前置步骤,包括:访问前置URL、执行前置JavaScript脚本等;执行登录步骤时具体如何填表、如何登录;以及执行登录后是否需要执行后置步骤,包括:执行后置URL、执行后置JavaScript脚本等。Wherein, the login configuration rule stored in the second configuration table that matches the target webpage identifier specifically records the login operation process of the webpage where the target webpage identifier is located, for example: whether it is necessary to perform pre-steps, including: accessing the pre-URL, executing Front-end JavaScript scripts, etc.; how to fill in the form and how to log in when performing the login steps; and whether post-steps need to be executed after login, including: executing post-URL, post-post JavaScript scripts, etc.
其中,第一配置表为匹配目标网页的登录URL获取对应的登录配置规则提供了索引,使得匹配登录配置规则的时间进一步降低。Wherein, the first configuration table provides an index for matching the login URL of the target webpage to obtain the corresponding login configuration rule, so that the time for matching the login configuration rule is further reduced.
S203,将登录流程标识设置为开始。S203. Set the logon of the login process as start.
S204,子进程判断所述登录配置规则中是否包括前置步骤,若包括,按照所述登录配置规则执行所述前置步骤。S204, the subprocess judges whether the login configuration rule includes a pre-step, and if so, executes the pre-step according to the login configuration rule.
其中,按照所述登录配置规则执行前置步骤,具体包括:Among them, the pre-steps are performed according to the login configuration rules, specifically including:
加载所述前置步骤中预设的前置URL和/或执行所述前置步骤中预设的JavaScript脚本。Loading the pre-preset URL in the pre-step and/or executing the pre-set JavaScript script in the pre-step.
S205,判断所述登录配置规则中是否包括动态库拦截步骤,若包括,则拦截所述目标网页对应的动态链接库。S205. Determine whether the login configuration rule includes a dynamic library interception step, and if yes, intercept the dynamic link library corresponding to the target webpage.
本发明实施例中,使用系统的hook机制,将系统中的动态连接库装载方法LoadLibrary()替换为自定义的动态链接库装载方法MyLoadLibrary()。以Windows系统为例,通知系统用MyLoadlibrary替换系统的Loadlibrary的命令行代码示例如下:In the embodiment of the present invention, the system's hook mechanism is used to replace the dynamic link library loading method LoadLibrary() in the system with a self-defined dynamic link library loading method MyLoadLibrary(). Taking the Windows system as an example, the command line code example to notify the system to replace the system's Loadlibrary with MyLoadlibrary is as follows:
DetourAttach(&(PVOID&)Loadlibrary,MyLoadlibrary)DetourAttach(&(PVOID&)Loadlibrary,MyLoadlibrary)
在MyLoadLibrary()方法中,若检测到当前装载的动态链接库是需要拦截的动态链接库,则对该动态链接库进行拦截;若当前装载的动态链接库不需要拦截,则使用系统的LoadLibrary()正常加载该动态链接库。In the MyLoadLibrary() method, if it is detected that the currently loaded dynamic link library is a dynamic link library that needs to be intercepted, then the dynamic link library is intercepted; if the currently loaded dynamic link library does not need to be intercepted, then the system's LoadLibrary( ) to load the dynamic link library normally.
下面,举例说明:Below, an example to illustrate:
假设需要拦截的动态链接库为msn.dll,并且正常加载flash.dll,定义的MyLoadLibrary()方法具体描述如下:Assuming that the dynamic link library to be intercepted is msn.dll, and flash.dll is loaded normally, the defined MyLoadLibrary() method is specifically described as follows:
通过以上描述可知,现有技术加载网页时调用系统Loadlibrary("msn.dll"),msn.dll加载成功;本发明实施例使用hook加载msn.dll和flash.dll,由于调用对msn.dll做了拦截,所以装载msn.dll会失败,而装载flash.dll会成功,具体如下:As can be seen from the above description, when the prior art loads a web page, the system Loadlibrary("msn.dll") is called, and msn.dll is loaded successfully; The interception is disabled, so the loading of msn.dll will fail, but the loading of flash.dll will succeed, as follows:
MyLoadlibrary("msn.dll")—>不调用Loadlibrary("msn.dll")—>加载msn.dll失败;MyLoadlibrary("msn.dll")—>Do not call Loadlibrary("msn.dll")—>Failed to load msn.dll;
MyLoadlibrary("flash.dll")—>调用Loadlibrary("flash.dll")—>加载flash.dll成功MyLoadlibrary("flash.dll")—>call Loadlibrary("flash.dll")—>load flash.dll successfully
S206,子进程在对应的子窗口中加载所述目标网页标识对应的目标网页。S206, the subprocess loads the target webpage corresponding to the target webpage identifier in the corresponding subwindow.
S207,子进程对目标网页中的元素进行定位确定登录对象。S207, the subprocess locates the elements in the target webpage to determine the login object.
S208,子进程将登录信息标识对应的登录信息填充到所述登录对象中,所诉登录信息包括登录账号信息和/或登录密码信息。S208. The subprocess fills the login object with the login information corresponding to the login information identifier, where the login information includes login account information and/or login password information.
进一步的,所述将对应的登录信息填充到所述登录对象中具体包括:Further, the filling the corresponding login information into the login object specifically includes:
子进程判断所述登录配置规则中是否包括密码输入控制,若包括,则依据所述登录配置规则向所述登录对象中填充登录账号信息;依据所述登录配置规则中的密码输入控制信息向所述登录对象中填充登录密码,所述密码输入控制信息包括密码输入时间间隔。The subprocess judges whether password input control is included in the login configuration rule, and if so, fills the login account information into the login object according to the login configuration rule; The login object is filled with a login password, and the password input control information includes a password input time interval.
若网站的登录页面要求必须按一定时间间隔输入密码,则将密码输入时间间隔存储到该登录页面对应的登录配置规则中,当子进程对登录密码输入框进行填充时,依据对应的登录配置规则中记录的密码输入时间间隔填充密码,有效提高了登录信息填充的成功率。If the login page of the website requires that the password must be entered at a certain time interval, the password input time interval is stored in the login configuration rule corresponding to the login page, and when the sub-process fills the login password input box, according to the corresponding login configuration rule Fill in the password at the password input time interval recorded in , which effectively improves the success rate of filling in the login information.
S209,子进程判断所述网页中的登录对象是否包校验码输入框,若包括,则结束当前操作。S209, the subprocess judges whether the login object in the webpage includes a verification code input box, and if so, ends the current operation.
本步骤为可选步骤,若本领域技术人员在实施本发明时可确定对校验码输入框的识别具有一定的成功率则可忽略本步骤。This step is an optional step, and can be ignored if those skilled in the art can determine that the identification of the check code input box has a certain success rate when implementing the present invention.
S210,子进程判断所述网页中的登录对象是否包括登录按钮,若包括,则对所述登录按钮执行点击操作。S210, the subprocess judges whether the login object in the web page includes a login button, and if so, performs a click operation on the login button.
另外,也可以预先将是否对登录按钮执行点击操作配置在登录配置规则中,当登录信息填充完成后,依据登录配置规则对登录按钮执行点击操作。In addition, whether to perform a click operation on the login button can also be pre-configured in the login configuration rule. After the login information is filled, the click operation is performed on the login button according to the login configuration rule.
S211,子进程判断所述登录配置规则中是否包括后置步骤,若包括,按照所述登录配置规则执行所述后置步骤。S211, the subprocess judges whether the login configuration rule includes post-steps, and if so, executes the post-steps according to the login configuration rule.
其中,按照登录配置规则执行后置步骤,具体包括:Among them, follow the login configuration rules to perform post-processing steps, including:
加载所述后置步骤中预设的后置URL和/或执行所述后置步骤中预设的JavaScript脚本。Loading the preset post URL in the post step and/or executing the preset JavaScript script in the post step.
通过执行后置步骤,可在对当前窗口中的网页执行登录步骤后跳转至指定的后置URL。Perform post-step to jump to the specified post-url after performing the login step on the web page in the current window.
S212,将登录流程标识设置为结束。S212. Set the login process identifier to end.
在上述实施例中,通过在登录步骤前执行前置步骤和/或后置步骤,使得对网页进行的登录操作完全映射用户手工完成登录操作时的动作流程,避免了网站中预设的登录限制,提高了登录的成功率。In the above-mentioned embodiment, by performing pre-steps and/or post-steps before the login step, the login operation on the web page completely maps the action flow when the user completes the login operation manually, avoiding the preset login restrictions in the website , improving the success rate of login.
其中,步骤S203、S212为可选步骤。通过设置登录流程标识记录当前子进程对网页的登录流程状态,对于登录流程标识为结束的子进程,对其子窗口中的网页不再执行登录信息填充和登录按钮点击操作,有效避免了重复登录,节约了系统资源。Wherein, steps S203 and S212 are optional steps. By setting the login process identifier to record the login process status of the current sub-process to the web page, for the sub-process whose login process is marked as ended, it will no longer perform login information filling and login button click operations on the webpage in its sub-window, effectively avoiding repeated logins , saving system resources.
本发明上述实施例中,首先通过对网页中的元素进行定位确定登录对象,然后对所述登录对象填充登录信息,因此,如何准确定位并确定出登录对象是上述实施例得以有效实施的前提,为此,本发明提供了对目标网页中的元素进行定位确定登录对象的具体方法,包括:In the above embodiments of the present invention, firstly, the login object is determined by locating the elements in the web page, and then the login information is filled in the login object. Therefore, how to accurately locate and determine the login object is the prerequisite for the effective implementation of the above embodiment. For this reason, the present invention provides a specific method for locating the elements in the target webpage to determine the login object, including:
S301,获取网页中的全部标签对象生成标签集合。S301. Acquire all tag objects in the webpage to generate a tag set.
其中,所述标签对象是<input>输入框。Wherein, the label object is an <input> input box.
S302,根据所述标签集合中标签对象的公共属性,对所述标签对象进行分组,从所述分组的结果获得一个或多个分组标签。S302. Group the tag objects according to the common attributes of the tag objects in the tag set, and obtain one or more group tags from the grouping result.
其中,根据所述标签集合中标签对象的公共属性,对所述标签对象进行分组具体包括:将标签集合中具有相同父节点的标签对象置于同一分组标签内。Wherein, according to the common attributes of the label objects in the label set, grouping the label objects specifically includes: placing label objects with the same parent node in the label set in the same grouping label.
S303,分组标签再分组。S303, the grouping label is grouped again.
本步骤具体包括:This step specifically includes:
判断当前分组结果中一个或多个分组标签;Determine one or more grouping labels in the current grouping result;
若当前分组标签包含两个或多个标签对象,且所述两个或多个标签对象不具有相同的父节点,则将当前分组标签内具有相同父节点的标签对象置于另一分组标签内;If the current group label contains two or more label objects, and the two or more label objects do not have the same parent node, put the label objects with the same parent node in the current group label into another group label ;
重复上述步骤直到当前分组标签不可再分组。Repeat the above steps until the current group label can no longer be grouped.
S304,依据预置的标记文件解析映射表,匹配所述一个或多个分组标签中的标签对象的属性。S304. Match attributes of tag objects in the one or more group tags according to the preset tag file parsing mapping table.
所述依据预置的标记文件解析映射表,匹配所述一个或多个分组标签中的标签对象的属性,具体包括:The parsing of the mapping table according to the preset tag file, matching the attributes of the tag objects in the one or more group tags, specifically includes:
若当前分组标签中仅含有1个密码输入框,且位于所述密码输入框下级兄弟节点的标签对象不是文本输入框,则当前分组标签为登录表单。If the current group label contains only one password input box, and the label object located in the lower sibling node of the password input box is not a text input box, then the current group label is a login form.
S305,确定相匹配的分组标签为登录对象。S305. Determine that the matching group tag is a login object.
其中,确定相匹配的分组标签为登录对象,具体包括:Among them, it is determined that the matching group label is the login object, specifically including:
所述登录表单的元素为登录对象;所述登录表单中的文本输入框为登录账号输入框,所述登录表单中的密码输入框为登录密码输入框。The element of the login form is a login object; the text input box in the login form is a login account input box, and the password input box in the login form is a login password input box.
对于网页中的<input>输入框,并非所有的密码输入框就一定是登录对象,例如,很多网页的不同Frame中会同时存在登录表单、注册表单、密码重置表单等,这样一来,若仅根据是否包含密码输入框定位登录对象则很容易出现定位错误,因此,本发明实施例通过将网页中具有相同父节点的标签对象置于同一分组标签,然后对分组标签进行再分组,并按照标记文件解析映射表确定网页中的登录表单,可以大大提高登录对象定位的准确性。For <input> input boxes in web pages, not all password input boxes must be login objects. For example, there are login forms, registration forms, and password reset forms in different frames of many web pages. Locating the login object only based on whether it contains a password input box is prone to positioning errors. Therefore, in the embodiment of the present invention, the label objects with the same parent node in the web page are placed in the same grouping label, and then the grouping label is regrouped, and according to The tag file parsing mapping table determines the login form in the webpage, which can greatly improve the accuracy of login object location.
进一步的,按照上述方法定位网页中的登录对象不受登录对象本身属性的限制,即使网站对登录网页中登录对象的ID、名称、位置信息进行改变,依然能够准确定位出登录对象,避免了现有技术中技术人员必须按照网站的内容修改定位规则的问题,大大减少了人工和维护成本。Further, according to the above method, locating the login object in the webpage is not limited by the attributes of the login object itself, even if the website changes the ID, name, and location information of the login object in the login webpage, it can still accurately locate the login object, avoiding the current situation. There is a problem that technicians in the technology must modify the positioning rules according to the content of the website, which greatly reduces labor and maintenance costs.
在本发明的另一扩展实施例中,所述登录配置规则还包括:白名单。所述子进程对目标网页中的元素进行定位确定登录对象还包括:子进程按照白名单对网页中的元素进行定位确定登录对象。所述白名单中根据网页中元素的名称、ID配置好密码输入框、登录按钮为确定的登录对象。在定位登录对象时,首先依据所述白名单中配置的信息确定出登录对象,若定位失败,再依据后续步骤进行定位。由于白名单中已经配置了网页中登录对象属性信息,因此可直接进行定位,避免了后续步骤中按标签分组定位登录对象过程中所需的大量运算和匹配操作,大大降低了系统资源消耗。In another extended embodiment of the present invention, the login configuration rule further includes: a white list. The subprocess locating the elements in the target webpage to determine the login object further includes: the subprocess locates the elements in the webpage to determine the login object according to the white list. In the white list, the password input box and the login button are configured according to the names and IDs of the elements in the webpage as the determined login objects. When locating the login object, the login object is first determined according to the information configured in the white list, and if the location fails, then the location is performed according to the subsequent steps. Since the attribute information of the login object in the webpage has been configured in the white list, it can be directly located, avoiding a large number of calculations and matching operations required in the subsequent steps of locating the login object by label group, and greatly reducing the consumption of system resources.
实施例三Embodiment three
参见图4,图4示出了本发明实施例提供的一种在网页中进行登录的装置的结构示意图,所述装置包括:主进程模块410、子进程模块420;Referring to FIG. 4, FIG. 4 shows a schematic structural diagram of a device for logging in a web page provided by an embodiment of the present invention, the device includes: a main process module 410, a sub-process module 420;
所述主进程模块410包括:The main process module 410 includes:
子进程启动模块411,用于启动一个子进程,并向所述子进程发送当前要登录的目标网页信息,所述目标网页信息包括目标网页标识、登录信息标识;The sub-process starting module 411 is used to start a sub-process, and sends the target web page information to be logged in to the sub-process, and the target web page information includes a target web page identification and a login information identification;
所述子进程模块420包括:The subprocess module 420 includes:
登录配置规则获取模块421,用于获取目标网页标识对应的登录配置规则;A login configuration rule acquisition module 421, configured to acquire a login configuration rule corresponding to the target web page identifier;
网页加载模块422,用于依据所述登录配置规则加载所述目标网页标识对应的网页;A webpage loading module 422, configured to load the webpage corresponding to the target webpage identifier according to the login configuration rule;
登录对象确定模块423,用于对所述目标网页中的元素进行定位确定登录对象;A login object determination module 423, configured to locate elements in the target webpage to determine a login object;
登录信息填充模块424,用于将所述登录信息标识对应的登录信息填充到所述登录对象中,所诉登录信息包括登录账号信息和/或登录密码信息;A login information filling module 424, configured to fill the login information corresponding to the login information identifier into the login object, where the login information includes login account information and/or login password information;
其中,所述网页加载模块422,具体用于加载所述目标网页标识对应的目标网页;判断所述登录配置规则中是否包括动态库拦截步骤,若包括,则拦截所述目标网页对应的动态链接库。Wherein, the webpage loading module 422 is specifically used to load the target webpage corresponding to the target webpage identifier; determine whether the login configuration rule includes a dynamic library interception step, and if so, intercept the dynamic link corresponding to the target webpage library.
其中,所述网页加载模块422,具体还用于判断所述登录配置规则中是否包括前置步骤,若包括,按照所述登录配置规则执行所述前置步骤。Wherein, the webpage loading module 422 is specifically further configured to determine whether the login configuration rule includes a pre-step, and if so, execute the pre-step according to the login configuration rule.
其中,所述网页加载模块422,具体还用于加载所述前置步骤中预设的前置URL和/或执行所述前置步骤中预设的JavaScript脚本。Wherein, the web page loading module 422 is further specifically configured to load the preset URL in the preceding step and/or execute the JavaScript script preset in the preceding step.
其中,所述登录信息填充模块424,具体用于判断所述登录配置规则中是否包括密码输入控制,若包括,则依据所述登录配置规则向所述登录对象中填充登录账号信息;依据所述登录配置规则中的密码输入控制信息向所述登录对象中填充登录密码,所述密码输入控制信息包括密码输入时间间隔。Wherein, the login information filling module 424 is specifically used to judge whether the password input control is included in the login configuration rule, and if so, fill the login account information into the login object according to the login configuration rule; The password input control information in the login configuration rule fills the login object with a login password, and the password input control information includes a password input time interval.
其中,所述登录配置规则获取模块421,具体用于根据当前要访问的网页信息中的登录URL匹配第一配置表,所述第一配置表中包括网页URL类别和对应的第二配置表标识;根据匹配出的第二配置表标识从第二配置表中获取对应的登录配置规则。Wherein, the login configuration rule acquisition module 421 is specifically configured to match the first configuration table according to the login URL in the webpage information to be accessed currently, and the first configuration table includes the webpage URL category and the corresponding second configuration table identifier ; Obtain the corresponding login configuration rule from the second configuration table according to the matched second configuration table identifier.
其中,所述子进程模块420还包括:Wherein, the subprocess module 420 also includes:
按钮点击模块425,用于判断所述网页中的登录对象是否包括登录按钮,若包括,则对所述登录按钮执行点击操作。The button clicking module 425 is used to judge whether the login object in the webpage includes a login button, and if yes, perform a click operation on the login button.
其中,所述子进程模块420,还包括:Wherein, the subprocess module 420 also includes:
校验输入模块426,用于判断所述网页中的登录对象是否包校验码输入框,若包括,则结束当前操作。The verification input module 426 is used for judging whether the login object in the web page includes a verification code input box, and if so, ends the current operation.
其中,所述子进程模块420,还包括:Wherein, the subprocess module 420 also includes:
后置步骤模块427,用于判断所述登录配置规则中是否包括后置步骤,若包括,按照所述登录配置规则执行所述后置步骤。The post-step module 427 is configured to determine whether the post-step is included in the login configuration rule, and if so, execute the post-step according to the login configuration rule.
其中,所述后置步骤模块427,具体用于:加载所述后置步骤中预设的后置URL和/或执行所述后置步骤中预设的JavaScript脚本。Wherein, the post-step module 427 is specifically configured to: load the pre-set post-URL in the post-step and/or execute the preset JavaScript script in the post-step.
其中,所述登录对象确定模块423,具体用于:Wherein, the login object determination module 423 is specifically used for:
获取网页中的全部标签对象生成标签集合;Get all label objects in the web page to generate a label collection;
根据所述标签集合中标签对象的公共属性,对所述标签对象进行分组,从所述分组的结果获得一个或多个分组标签;group the tag objects according to the common attributes of the tag objects in the tag set, and obtain one or more group tags from the grouping result;
依据预置的标记文件解析映射表,匹配所述一个或多个分组标签中的标签对象的属性;Parse the mapping table according to the preset tag file, and match the attributes of the tag objects in the one or more group tags;
确定相匹配的分组标签为登录对象。Determine the matching group label as the login object.
其中,所述登录对象确定模块423根据所述标签集合中标签对象的公共属性对所述标签对象进行分组,具体包括:将标签集合中具有相同父节点的标签对象置于同一分组标签内。Wherein, the login object determination module 423 groups the tag objects according to the common attributes of the tag objects in the tag set, specifically including: placing tag objects with the same parent node in the tag set in the same grouping tag.
其中,所述登录对象确定模块423还用于:Wherein, the login object determining module 423 is also used for:
分组标签再分组,具体包括:Grouping tags are grouped again, including:
判断当前分组结果中一个或多个分组标签;Determine one or more grouping labels in the current grouping result;
若当前分组标签包含两个或多个标签对象,且所述两个或多个标签对象不具有相同的父节点,则将当前分组标签内具有相同父节点的标签对象置于另一分组标签内;If the current group label contains two or more label objects, and the two or more label objects do not have the same parent node, put the label objects with the same parent node in the current group label into another group label ;
重复上述步骤直到当前分组标签不可再分组。Repeat the above steps until the current group label can no longer be grouped.
其中,所述标签对象是<input>输入框;Wherein, the label object is an <input> input box;
所述登录对象确定模块423依据预置的标记文件解析映射表,匹配所述一个或多个分组标签中的标签对象的属性还用于:The login object determination module 423 parses the mapping table according to the preset tag file, matches the attribute of the tag object in the one or more group tags and is also used for:
若当前分组标签中仅含有1个密码输入框,且位于所述密码输入框下级兄弟节点的标签对象不是文本输入框,则当前分组标签为登录表单;If there is only one password input box in the current group label, and the label object located in the sibling node of the password input box is not a text input box, then the current group label is a login form;
所述登录对象确定模块423确定相匹配的分组标签为登录对象,具体用于:The login object determining module 423 determines that the matching grouping tag is a login object, specifically for:
所述登录表单的元素为登录对象;所述登录表单中的文本输入框为登录账号输入框,所述登录表单中的密码输入框为登录密码输入框。The element of the login form is a login object; the text input box in the login form is a login account input box, and the password input box in the login form is a login password input box.
其中,所述子进程模块420还包括:Wherein, the subprocess module 420 also includes:
登录流程状态标记模块428,用于对所述网页中的登录对象进行定位之前,将登录流程标识设置为开始;以及在将对应的登录信息填充到所述登录对象中之后,将登录流程标识设置为结束。The login process status marking module 428 is configured to set the login process identifier as start before locating the login object in the web page; and after filling the corresponding login information into the login object, set the login process identifier to for the end.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的网页中进行登录的装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in the device for logging in a web page according to an embodiment of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.
本发明公开了A1、一种在网页中进行登录的方法,包括:The invention discloses A1. A method for logging in a webpage, comprising:
主进程启动一个子进程,并向所述子进程发送当前要登录的目标网页信息,所述目标网页信息包括目标网页标识、登录信息标识;The main process starts a sub-process, and sends the current target webpage information to be logged in to the sub-process, and the target webpage information includes a target webpage identifier and a login information identifier;
子进程获取所述目标网页标识对应的登录配置规则;The sub-process obtains the login configuration rule corresponding to the target web page identifier;
子进程依据所述登录配置规则加载所述目标网页标识对应的目标网页;The subprocess loads the target webpage corresponding to the target webpage identifier according to the login configuration rule;
子进程对所述目标网页中的元素进行定位确定登录对象;The subprocess locates the elements in the target webpage to determine the login object;
将对应的登录信息填充到所述登录对象中,所述登录信息包括登录账号信息和/或登录密码信息;filling the corresponding login information into the login object, the login information including login account information and/or login password information;
其中,所述子进程依据所述登录配置规则加载所述目标网页标识对应的目标网页,具体包括:Wherein, the sub-process loads the target webpage corresponding to the target webpage identifier according to the login configuration rule, specifically including:
加载所述目标网页标识对应的目标网页;Loading the target webpage corresponding to the target webpage identifier;
判断所述登录配置规则中是否包括动态库拦截步骤,若包括,则拦截所述目标网页对应的动态链接库。It is judged whether the dynamic library interception step is included in the login configuration rule, and if yes, the dynamic link library corresponding to the target web page is intercepted.
A2、如A1所述的方法,所述子进程依据所述登录配置规则加载所述目标网页标识对应的目标网页,还包括:A2. The method as described in A1, wherein the subprocess loads the target webpage corresponding to the target webpage identifier according to the login configuration rule, and further includes:
判断所述登录配置规则中是否包括前置步骤,若包括,则按照所述登录配置规则执行所述前置步骤。Judging whether the login configuration rule includes a pre-step, and if so, executing the pre-step according to the login configuration rule.
A3、如A2所述的方法,A3, the method as described in A2,
所述按照所述登录配置规则执行前置步骤,具体包括:The performing the pre-steps according to the login configuration rules specifically includes:
加载所述前置步骤中预设的前置URL和/或执行所述前置步骤中预设的JavaScript脚本。Loading the pre-preset URL in the pre-step and/or executing the pre-set JavaScript script in the pre-step.
A4、如A2所述的方法,所述将对应的登录信息填充到所述登录对象中具体包括:A4. The method as described in A2, the filling the corresponding login information into the login object specifically includes:
子进程判断所述登录配置规则中是否包括密码输入控制,若包括,则依据所述登录配置规则向所述登录对象中填充登录账号信息;依据所述登录配置规则中的密码输入控制信息向所述登录对象中填充登录密码,所述密码输入控制信息包括密码输入时间间隔。The subprocess judges whether password input control is included in the login configuration rule, and if so, fills the login account information into the login object according to the login configuration rule; The login object is filled with a login password, and the password input control information includes a password input time interval.
A5、如A1所述的方法,所述子进程获取所述目标网页标识对应的登录配置规则,具体包括:A5, the method as described in A1, the subprocess obtains the login configuration rule corresponding to the target webpage identifier, specifically including:
子进程根据当前要访问的网页信息中的登录URL匹配第一配置表,所述第一配置表中包括网页URL类别和对应的第二配置表标识;The subprocess matches the first configuration table according to the login URL in the web page information to be accessed currently, and the first configuration table includes a web page URL category and a corresponding second configuration table identification;
子进程根据匹配出的第二配置表标识从第二配置表中获取对应的登录配置规则。The sub-process obtains the corresponding login configuration rule from the second configuration table according to the matched second configuration table identifier.
A6、如A1所述的方法,所述方法还包括:A6, the method as described in A1, said method also includes:
子进程判断所述网页中的登录对象是否包括登录按钮,若包括,则对所述登录按钮执行点击操作。The sub-process judges whether the login object in the web page includes a login button, and if so, performs a click operation on the login button.
A7、如A6所述的方法,所述对登录按钮执行点击操作之前,还包括:A7, the method as described in A6, before performing the click operation on the login button, it also includes:
判断所述网页中的登录对象是否包括校验码输入框,若包括,则所述方法终止。It is judged whether the login object in the web page includes a verification code input box, and if so, the method is terminated.
A8如A6或A7所述的方法,所述对所述登录按钮执行点击操作之后还包括:A8 The method described in A6 or A7, after performing the click operation on the login button, it also includes:
判断所述登录配置规则中是否包括后置步骤,若包括,则按照所述登录配置规则执行所述后置步骤。It is judged whether the post-step is included in the login configuration rule, and if yes, the post-step is executed according to the login configuration rule.
A9、如A8所述的方法,A9, the method as described in A8,
所述按照所述登录配置规则执行所述后置步骤,具体包括:The performing the post steps according to the login configuration rules specifically includes:
加载所述后置步骤中预设的后置URL和/或执行所述后置步骤中预设的JavaScript脚本。Loading the preset post URL in the post step and/or executing the preset JavaScript script in the post step.
A10、如A1所述的方法,所述对所述目标网页中的元素进行定位确定登录对象,具体包括:A10. The method as described in A1, wherein the elements in the target webpage are positioned to determine the login object, specifically including:
获取目标网页中的全部标签对象生成标签集合;Obtain all label objects in the target web page to generate a label collection;
根据所述标签集合中标签对象的公共属性,对所述标签对象进行分组,从所述分组的结果获得一个或多个分组标签;group the tag objects according to the common attributes of the tag objects in the tag set, and obtain one or more group tags from the grouping result;
依据预置的标记文件解析映射表,匹配所述一个或多个分组标签中的标签对象的属性;Parse the mapping table according to the preset tag file, and match the attributes of the tag objects in the one or more group tags;
确定相匹配的分组标签为登录对象。Determine the matching group label as the login object.
A11、如A10所述的方法,根据所述标签集合中标签对象的公共属性对所述标签对象进行分组,包括:A11. The method as described in A10, grouping the label objects according to the public attributes of the label objects in the label collection, including:
将标签集合中具有相同父节点的标签对象置于同一分组标签内。Place label objects with the same parent node in the label collection into the same grouping label.
A12、如A10所述的方法,所述从所述分组的结果获得一个或多个分组标签之后还包括:A12. The method as described in A10, after obtaining one or more grouping labels from the grouping result, it also includes:
分组标签再分组,具体包括:Grouping tags are grouped again, including:
判断当前分组结果中一个或多个分组标签;Determine one or more grouping labels in the current grouping result;
若当前分组标签包含两个或多个标签对象,且所述两个或多个标签对象不具有相同的父节点,则将当前分组标签内具有相同父节点的标签对象置于另一分组标签内;If the current group label contains two or more label objects, and the two or more label objects do not have the same parent node, put the label objects with the same parent node in the current group label into another group label ;
重复上述步骤直到当前分组标签不可再分组。Repeat the above steps until the current group label can no longer be grouped.
A13、如A10所述的方法,所述标签对象是<input>输入框;A13, the method as described in A10, described label object is <input> input box;
所述依据预置的标记文件解析映射表,匹配所述一个或多个分组标签中的标签对象的属性还包括:The parsing the mapping table according to the preset tag file, and matching the attributes of the tag objects in the one or more group tags also includes:
若当前分组标签中仅含有1个密码输入框,且位于所述密码输入框下级兄弟节点的标签对象不是文本输入框,则当前分组标签为登录表单;If there is only one password input box in the current group label, and the label object located in the sibling node of the password input box is not a text input box, then the current group label is a login form;
所述确定相匹配的分组标签为登录对象,具体包括:The determination that the matching group label is the login object specifically includes:
所述登录表单的元素为登录对象;所述登录表单中的文本输入框为登录账号输入框,所述登录表单中的密码输入框为登录密码输入框。The element of the login form is a login object; the text input box in the login form is a login account input box, and the password input box in the login form is a login password input box.
A14、如A1所述的方法,所述子进程对所述目标网页中的元素进行定位确定登录对象之前,还包括:A14, the method as described in A1, before the subprocess locates the elements in the target webpage and determines the login object, it also includes:
将登录流程标识设置为开始;Set the login flow ID to start;
所述将对应的登录信息填充到所述登录对象中之后,还包括:After filling the corresponding login information into the login object, it also includes:
将登录流程标识设置为结束。Set the sign-in process flag to end.
本发明还公开了B15、一种在网页中进行登录的装置,包括:主进程模块、子进程模块;The present invention also discloses B15, a device for logging in a web page, including: a main process module and a sub-process module;
所述主进程模块包括:The main process module includes:
子进程启动模块,用于启动一个子进程,并向所述子进程发送当前要登录的目标网页信息,所述目标网页信息包括目标网页标识、登录信息标识;The sub-process starting module is used to start a sub-process, and send the current target webpage information to be logged in to the sub-process, and the target webpage information includes a target webpage identifier and a login information identifier;
所述子进程模块包括:The subprocess module includes:
登录配置规则获取模块,用于获取目标网页标识对应的登录配置规则;A login configuration rule obtaining module, configured to obtain a login configuration rule corresponding to the target web page identifier;
网页加载模块,用于依据所述登录配置规则加载所述目标网页标识对应的网页;A webpage loading module, configured to load a webpage corresponding to the target webpage identifier according to the login configuration rule;
登录对象确定模块,用于对所述目标网页中的元素进行定位确定登录对象;A login object determination module, configured to locate elements in the target webpage to determine a login object;
登录信息填充模块,用于将所述登录信息标识对应的登录信息填充到所述登录对象中,所诉登录信息包括登录账号信息和/或登录密码信息;A login information filling module, configured to fill the login information corresponding to the login information identifier into the login object, where the login information includes login account information and/or login password information;
其中,所述网页加载模块,具体用于加载所述目标网页标识对应的目标网页;判断所述登录配置规则中是否包括动态库拦截步骤,若包括,则拦截所述目标网页对应的动态链接库。Wherein, the webpage loading module is specifically used to load the target webpage corresponding to the target webpage identifier; determine whether the login configuration rule includes a dynamic library interception step, and if so, intercept the dynamic link library corresponding to the target webpage .
B16、如B15所述的装置,B16. A device as described in B15,
所述网页加载模块,具体还用于判断所述登录配置规则中是否包括前置步骤,若包括,按照所述登录配置规则执行所述前置步骤。The webpage loading module is specifically further configured to determine whether the login configuration rule includes a pre-step, and if so, execute the pre-step according to the login configuration rule.
B17、如B16所述的装置,其特征在于,B17, the device as described in B16, is characterized in that,
所述网页加载模块,具体还用于加载所述前置步骤中预设的前置URL和/或执行所述前置步骤中预设的JavaScript脚本。The webpage loading module is specifically further configured to load the preset URL in the preceding step and/or execute the JavaScript script preset in the preceding step.
B18、如B15所述的装置,其特征在于,B18, the device as described in B15, is characterized in that,
所述登录信息填充模块,具体用于判断所述登录配置规则中是否包括密码输入控制,若包括,则依据所述登录配置规则向所述登录对象中填充登录账号信息;依据所述登录配置规则中的密码输入控制信息向所述登录对象中填充登录密码,所述密码输入控制信息包括密码输入时间间隔。The login information filling module is specifically used to judge whether the password input control is included in the login configuration rules, and if so, fill the login account information into the login object according to the login configuration rules; The password input control information in fills the login object with a login password, and the password input control information includes a password input time interval.
B19、如B15所述的装置,B19. A device as described in B15,
所述登录配置规则获取模块,具体用于根据当前要访问的网页信息中的登录URL匹配第一配置表,所述第一配置表中包括网页URL类别和对应的第二配置表标识;根据匹配出的第二配置表标识从第二配置表中获取对应的登录配置规则。The login configuration rule acquisition module is specifically used to match the first configuration table according to the login URL in the webpage information to be accessed currently, and the first configuration table includes the web page URL category and the corresponding second configuration table identifier; according to the matching The obtained second configuration table identifier obtains the corresponding login configuration rule from the second configuration table.
B20、如B15所述的装置,所述子进程模块还包括:B20, the device as described in B15, the subprocess module also includes:
按钮点击模块,用于判断所述网页中的登录对象是否包括登录按钮,若包括,则对所述登录按钮执行点击操作。The button clicking module is used for judging whether the login object in the web page includes a login button, and if yes, performs a click operation on the login button.
B21、如B20所述的装置,所述子进程模块,还包括:B21, the device as described in B20, the subprocess module also includes:
校验输入模块,用于判断所述网页中的登录对象是否包校验码输入框,若包括,则结束当前操作。The verification input module is used for judging whether the login object in the webpage includes a verification code input box, and if so, ends the current operation.
B22、如B15或B16所述的装置,其特征在于,所述子进程模块,还包括:B22, the device as described in B15 or B16, is characterized in that, described subprocess module also includes:
后置步骤模块,用于判断所述登录配置规则中是否包括后置步骤,若包括,按照所述登录配置规则执行所述后置步骤。The post-step module is used to judge whether the post-step is included in the login configuration rule, and if so, execute the post-step according to the login configuration rule.
B23、如B22所述的装置,所述后置步骤模块,具体用于:加载所述后置步骤中预设的后置URL和/或执行所述后置步骤中预设的JavaScript脚本。B23. The device according to B22, wherein the post-step module is specifically configured to: load the pre-set post URL in the post-step and/or execute the preset JavaScript script in the post-step.
B24、如B15所述的装置,所述登录对象确定模块,具体用于:B24. The device as described in B15, the login object determination module is specifically used for:
获取网页中的全部标签对象生成标签集合;Get all label objects in the web page to generate a label collection;
根据所述标签集合中标签对象的公共属性,对所述标签对象进行分组,从所述分组的结果获得一个或多个分组标签;group the tag objects according to the common attributes of the tag objects in the tag set, and obtain one or more group tags from the grouping result;
依据预置的标记文件解析映射表,匹配所述一个或多个分组标签中的标签对象的属性;Parse the mapping table according to the preset tag file, and match the attributes of the tag objects in the one or more group tags;
确定相匹配的分组标签为登录对象。Determine the matching group label as the login object.
B25、如B24所述的装置,所述登录对象确定模块根据所述标签集合中标签对象的公共属性对所述标签对象进行分组,具体包括:将标签集合中具有相同父节点的标签对象置于同一分组标签内。B25. The device as described in B24, the login object determination module groups the tag objects according to the public attributes of the tag objects in the tag set, specifically including: placing tag objects with the same parent node in the tag set within the same grouping tag.
B26、如权利要求B24所述的装置,所述登录对象确定模块还用于:B26, the device as claimed in claim B24, said login object determination module is also used for:
分组标签再分组,具体包括:Grouping tags are grouped again, including:
判断当前分组结果中一个或多个分组标签;Determine one or more grouping labels in the current grouping result;
若当前分组标签包含两个或多个标签对象,且所述两个或多个标签对象不具有相同的父节点,则将当前分组标签内具有相同父节点的标签对象置于另一分组标签内;If the current group label contains two or more label objects, and the two or more label objects do not have the same parent node, put the label objects with the same parent node in the current group label into another group label ;
重复上述步骤直到当前分组标签不可再分组。Repeat the above steps until the current group label can no longer be grouped.
B27、如权利要求B24所述的装置,其特征在于,所述标签对象是<input>输入框;B27, the device as claimed in claim B24, is characterized in that, described label object is <input> input box;
所述登录对象确定模块依据预置的标记文件解析映射表,匹配所述一个或多个分组标签中的标签对象的属性还用于:The login object determination module parses the mapping table according to the preset tag file, matches the attributes of the tag objects in the one or more group tags and is also used for:
若当前分组标签中仅含有1个密码输入框,且位于所述密码输入框下级兄弟节点的标签对象不是文本输入框,则当前分组标签为登录表单;If there is only one password input box in the current group label, and the label object located in the sibling node of the password input box is not a text input box, then the current group label is a login form;
所述登录对象确定模块确定相匹配的分组标签为登录对象,具体用于:The login object determining module determines that the matching grouping label is a login object, specifically for:
所述登录表单的元素为登录对象;所述登录表单中的文本输入框为登录账号输入框,所述登录表单中的密码输入框为登录密码输入框。The element of the login form is a login object; the text input box in the login form is a login account input box, and the password input box in the login form is a login password input box.
B28、如权利要求B15所述的装置,其特征在于,所述子进程模块还包括:B28, the device as claimed in claim B15, is characterized in that, described subprocess module also comprises:
登录流程状态标记模块,用于对所述网页中的登录对象进行定位之前,将登录流程标识设置为开始;以及在将对应的登录信息填充到所述登录对象中之后,将登录流程标识设置为结束。The login process status marking module is used to set the login process identifier to start before locating the login object in the web page; and after filling the corresponding login information into the login object, set the login process identifier to Finish.
Claims (28)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310682992.6A CN103646081B (en) | 2013-12-12 | 2013-12-12 | Method and device for logging in web page |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310682992.6A CN103646081B (en) | 2013-12-12 | 2013-12-12 | Method and device for logging in web page |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103646081A CN103646081A (en) | 2014-03-19 |
CN103646081B true CN103646081B (en) | 2017-01-18 |
Family
ID=50251295
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310682992.6A Active CN103646081B (en) | 2013-12-12 | 2013-12-12 | Method and device for logging in web page |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103646081B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104836861B (en) * | 2015-05-20 | 2018-09-21 | 国网山东阳信县供电公司 | A kind of website log system and Website logging method |
CN107807925A (en) * | 2016-09-08 | 2018-03-16 | 广州市动景计算机科技有限公司 | Browser bookmark method to set up and device and computing device |
US11909729B2 (en) | 2018-04-26 | 2024-02-20 | Google Llc | Auto-form fill based website authentication |
CN109246069B (en) * | 2018-06-15 | 2020-10-16 | 华为技术有限公司 | Webpage login method and device and readable storage medium |
CN112799741A (en) * | 2021-02-08 | 2021-05-14 | 北京乐学帮网络技术有限公司 | A method, device, electronic device and storage medium for application program avatar |
CN115277451B (en) * | 2022-07-28 | 2024-07-12 | 中译语通科技股份有限公司 | Account login information initialization method and system based on automatic simulator |
CN116644249A (en) * | 2023-04-07 | 2023-08-25 | 北京火山引擎科技有限公司 | Web page authentication method, device, medium and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102438000A (en) * | 2011-03-11 | 2012-05-02 | 奇智软件(北京)有限公司 | Multi-account login method and device |
CN102594813A (en) * | 2012-02-10 | 2012-07-18 | 奇智软件(北京)有限公司 | Multi-account login method and device |
CN103036993A (en) * | 2012-12-18 | 2013-04-10 | 北京奇虎科技有限公司 | Browser client-side and method of achieving website logging |
US8676973B2 (en) * | 2006-03-07 | 2014-03-18 | Novell Intellectual Property Holdings, Inc. | Light-weight multi-user browser |
-
2013
- 2013-12-12 CN CN201310682992.6A patent/CN103646081B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8676973B2 (en) * | 2006-03-07 | 2014-03-18 | Novell Intellectual Property Holdings, Inc. | Light-weight multi-user browser |
CN102438000A (en) * | 2011-03-11 | 2012-05-02 | 奇智软件(北京)有限公司 | Multi-account login method and device |
CN102594813A (en) * | 2012-02-10 | 2012-07-18 | 奇智软件(北京)有限公司 | Multi-account login method and device |
CN103036993A (en) * | 2012-12-18 | 2013-04-10 | 北京奇虎科技有限公司 | Browser client-side and method of achieving website logging |
Also Published As
Publication number | Publication date |
---|---|
CN103646081A (en) | 2014-03-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103646081B (en) | Method and device for logging in web page | |
US9954855B2 (en) | Login method and apparatus, and open platform system | |
US10412091B2 (en) | Systems and methods for controlling sign-on to web applications | |
US10055238B2 (en) | Method and apparatus for code virtualization and remote process call generation | |
CN104598513B (en) | A kind of method of data flow control and system based on web page frame | |
CN103647775B (en) | Method and apparatus for registration in webpage | |
WO2018001078A1 (en) | Url matching method and device, and storage medium | |
US20170093828A1 (en) | System and method for detecting whether automatic login to a website has succeeded | |
CN106357609B (en) | A kind of method and system, public network server and private clound equipment creating user | |
CN109688280A (en) | Request processing method, request processing equipment, browser and storage medium | |
CN105337949A (en) | SSO (Single Sign On) authentication method, web server, authentication center and token check center | |
US20160359989A1 (en) | Recording And Triggering Web And Native Mobile Application Events With Mapped Data Fields | |
JP2013508805A (en) | Data update for website users based on preset conditions | |
CN104021154B (en) | A kind of method and apparatus scanned in a browser | |
US20140019957A1 (en) | Method, apparatus, and system for sharing software among terminals | |
WO2013106925A1 (en) | Determining repeat website users via browser uniqueness tracking | |
CN105630499A (en) | Method and device for processing information | |
CN104679651B (en) | A kind of automated testing method and execute node | |
CN104618388B (en) | Fast registration login method and corresponding resetting server, information server | |
CN111107064B (en) | Terminal equipment identification method, device, equipment and readable storage medium | |
CN109948332A (en) | A kind of physical machine login password remapping method and device | |
CN106649109A (en) | Web testing method and system of intelligent terminal | |
CN110992131A (en) | Form processing method and device and storage medium | |
CN114430340A (en) | Cross-domain single sign-on method, device and equipment | |
US10044709B2 (en) | Multi-device single network sign-on |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220713 Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park) Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Patentee before: Qizhi software (Beijing) Co.,Ltd. |