CN105956136B - Method and device for acquiring login information - Google Patents

Method and device for acquiring login information Download PDF

Info

Publication number
CN105956136B
CN105956136B CN201610310776.2A CN201610310776A CN105956136B CN 105956136 B CN105956136 B CN 105956136B CN 201610310776 A CN201610310776 A CN 201610310776A CN 105956136 B CN105956136 B CN 105956136B
Authority
CN
China
Prior art keywords
login information
page
accessed
input element
input box
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
Application number
CN201610310776.2A
Other languages
Chinese (zh)
Other versions
CN105956136A (en
Inventor
刘嘉
李准
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610310776.2A priority Critical patent/CN105956136B/en
Publication of CN105956136A publication Critical patent/CN105956136A/en
Application granted granted Critical
Publication of CN105956136B publication Critical patent/CN105956136B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]

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 invention discloses a method and a device for acquiring login information. Wherein, the method comprises the following steps: receiving a page access request in a browser, wherein the page access request comprises a URL (uniform resource locator) of a page to be accessed; searching login information of a page to be accessed and a login information input box of the page to be accessed through a first plug-in of a browser; and if the login information and the login information input box are found, displaying the login information in the login information input box. The invention solves the technical problem that the login information input box and the login information cannot be obtained due to the fact that part of browsers do not have the functions of obtaining the login information and the login information input box in the prior art.

Description

Method and device for acquiring login information
Technical Field
The invention relates to the field of data processing, in particular to a method and a device for acquiring login information.
Background
Currently, a plurality of technical companies in the market all have services for providing account number saving or filling functions in browsers, and some services are developed based on products of the companies, such as chrome, Tencent, 360, cheetah and other browser companies; some are developed based on an Application Programming Interface (API) Interface of a browser, such as internet technologies, inc.
Although these companies all implement similar functions, their respective implementation schemes are different, which results in different functional points among different families and different user experiences and security.
The disadvantages of the prior art are substantially two-fold: the first is that the function cannot be used by 100% of all websites, and when some special websites are encountered, the searching algorithm of the account or the password needs to be adaptively modified, otherwise the function cannot be normally used. The second is the account number or password involved with the user, so security aspects are often challenged.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a method and a device for acquiring login information, which are used for at least solving the technical problem that a login information input box and login information cannot be acquired because part of browsers do not have the function of acquiring the login information and the login information input box in the prior art.
According to an aspect of the embodiments of the present invention, there is provided a method for acquiring login information, including: receiving a page access request in a browser, wherein the page access request comprises a URL (uniform resource locator) of a page to be accessed; searching the login information of the page to be accessed and the login information input box of the page to be accessed through a first plug-in of the browser; and if the login information and the login information input box are found, displaying the login information in the login information input box.
According to another aspect of the embodiments of the present invention, there is also provided an apparatus for acquiring login information, including: the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a page access request in a browser, and the page access request comprises a URL (uniform resource locator) of a page to be accessed; the searching unit is used for searching the login information of the page to be accessed and the login information input box of the page to be accessed through a first plug-in of the browser; and the display unit is used for displaying the login information in the login information input box under the condition that the login information and the login information input box are found.
In the embodiment of the invention, a page access request is received in a browser, wherein the page access request comprises a URL (uniform resource locator) of a page to be accessed; searching the login information of the page to be accessed and the login information input box of the page to be accessed through a first plug-in of the browser; and if the login information and the login information input box are found, displaying the login information in the login information input box. The login information and the login information input box of the page to be accessed are searched through the first plug-in, wherein the login information is displayed in the login information input box under the condition that the login information and the login information input box are searched, and compared with a browser which is not provided with the function of automatically searching the login information and the login information input box in the prior art, the purpose that the login information and the login information input box can be obtained through the first plug-in is achieved, so that the technical effect of accelerating the display speed of the login information input box and the login information is achieved, and the technical problem that the login information input box and the login information cannot be obtained due to the fact that a part of browsers do not have the function of obtaining the login information and the login information input box in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is an architecture diagram of a hardware architecture according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for acquiring login information according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a display interface of an optional login information input box, according to an embodiment of the present invention;
FIG. 4 is a schematic illustration of a display interface of an alternative login information input box according to an embodiment of the present invention;
FIG. 5 is a schematic illustration of a display interface of an alternative login information input box according to an embodiment of the present invention;
FIG. 6 is a schematic illustration of a display interface of an alternative login information input box in accordance with an embodiment of the present invention;
fig. 7 is a flowchart of an optional login information acquisition method according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a login information acquisition apparatus according to an embodiment of the present invention; and
fig. 9 is a hardware configuration diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Interpretation of professional terms
Cascading Style Sheets (CSS for short): CSS, a set of format setting rules, is used to control the appearance of a Web page. By formatting the page using CSS styles, the content of the page may be separated from the presentation.
Application Programming Interface (API for short): are predefined functions that are intended to provide applications and developers the ability to access a set of routines based on certain software or hardware without having to access source code or understand the details of the internal workings.
Uniform Resource Locator (URL for short): also known as web addresses, are addresses of standard resources on the internet.
Javascript: an object-oriented dynamic type client side scripting language can be used for controlling logic and display of HTML pages.
A database: the file cabinet can be simply regarded as an electronic file cabinet and used for storing electronic files, and a user can operate operations of adding, intercepting, updating, deleting and the like on data in the files.
Data synchronization: when a user operates data under the same account on multiple terminals, synchronous sharing of data information of the multiple terminals can be rapidly realized, and integrity and uniformity of the data of the user are kept.
Example 1
In accordance with an embodiment of the present invention, there is provided an embodiment of a method that may be performed by an embodiment of the apparatus of the present application, it being noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
According to the embodiment of the invention, the method for acquiring the login information is provided.
Alternatively, in this embodiment, the above-mentioned method for acquiring login information may be applied to a hardware environment formed by the server 104 and the terminal 102 shown in fig. 1. FIG. 1 is a schematic diagram of a hardware environment according to an embodiment of the present invention, and as shown in FIG. 1, a server 104 is connected to a terminal 102 through a network, including but not limited to: the terminal 102 is not limited to a computer, a mobile phone, a tablet computer, etc. in a wide area network, a metropolitan area network, or a local area network.
Fig. 2 is a flowchart of a method for acquiring login information according to an embodiment of the present invention, and the method for acquiring login information according to an embodiment of the present invention is described below with reference to fig. 2, as shown in fig. 2, the method for acquiring login information mainly includes the following steps S202 to S206:
step S202, a page access request is received in the browser, wherein the page access request comprises a URL of a page to be accessed.
In the embodiment of the present invention, the page to be accessed may be a page to which a login account needs to be input. The page access request received in the browser may be a request to log into the page, for example, a request to log into page a, a request to log into a web portal, etc. For example, when a user requests to log in a page of page a, after a point of any browser hits the page of page a, there is a "login" in the upper left corner of the page displayed at the present time, and when the user clicks the "login" identifier, an account and password input box is displayed. The input box is a login information input box of the page to be accessed, wherein if the user does not log in the page for the first time, an account and a password of the user logged in last time may be displayed in the input box, and if the user logs in the page for the first time, the input box prompts the user to input the account and the password.
And step S204, searching the login information of the page to be accessed and the login information input box of the page to be accessed through the first plug-in of the browser.
In the embodiment of the invention, the login information of the page to be accessed and the login information input box of the page to be accessed can be searched by the first plug-in arranged in the browser. The first plug-in may be a plug-in developed by a technician for acquiring a login information input box, and the plug-in may be installed in any browser.
In step S206, if the login information and the login information input box are found, the login information is displayed in the login information input box.
Assuming that the first plug-in finds the login information and the login information input box of the user in the "page a", the login information may be displayed in the login information input box, specifically, as shown in fig. 3, the login information input box is displayed in the page of the page a, wherein the login information input box includes a login account "test" and a login password, and the login password is hidden and displayed.
In the embodiment of the invention, the login information and the login information input box of the page to be accessed are searched through the first plug-in, wherein the login information is displayed in the login information input box under the condition that the login information and the login information input box are searched, and compared with a browser which is not provided with the function of automatically searching the login information and the login information input box in the prior art, the purpose that the login information and the login information input box can be obtained through the first plug-in is achieved, so that the technical effect of accelerating the display speed of the login information input box and the login information is realized, and the technical problem that the login information input box and the login information cannot be obtained due to the fact that a part of browsers are not provided with the function of obtaining the login information and the login information input box in the prior art is solved.
Optionally, the step S204 of searching the login information of the page to be accessed and the login information input box of the page to be accessed through the first plug-in of the browser includes the following steps:
step S2041, injecting the first script code of the first plug-in into the page to be accessed through the browser.
Step S2043, the login information of the page to be accessed is searched in the historical login information recorded by the browser through the injected first script code.
Step S2045, a login information input box is searched for in the page to be accessed through the first search logic indicated by the injected first script code.
Specifically, when the user accesses the website login page, the browser injects the first script code of the first account into the page to be accessed, where the first script code is of various types, and in the embodiment of the present invention, the first script code may be a Javascript script code. Therefore, injecting the first script code into the page to be accessed may be understood as injecting the Javascript script code into the page to be accessed. For example, when a user accesses "page a" in a browser a, and receives a request for accessing "page a", the Javascript code (hereinafter, abbreviated as Js script code) may be injected into the "page a" so that the Js script code searches for the login information of the user at "page a" in the history login information recorded in the browser, wherein the Js script code may search for the login information according to the URL of the website of the current page. Since each script code corresponds to a processing logic, in an embodiment of the present invention, the processing logic of the first script code is a first search logic, and the first search logic is used to search the login information input box.
If the Js script code determines that the account and the password are saved in the page to be accessed by the user, namely the account and the password are found in the historical login information recorded by the browser, the found account and password can be automatically filled in the login information input box and displayed in the login information input box under the condition that the Js script code finds the login information input box according to the indicated first searching logic. If the Js script code determines that the account and the password are not stored in the page to be accessed by the user, the Js script code can prompt the user to manually input login information (the account and the password) in a login information input box and prompt the user whether to store the login information input at this time.
Optionally, after the step S204 searches the login information input box in the page to be accessed through the first search logic indicated by the injected first script code, the following processing manners are included:
in the first mode, if the login information input box cannot be found in the page to be accessed, a search failure result is sent to the server, wherein the search failure result is used for indicating the URL.
Specifically, if the login information input box is not found in the first search logic indicated by the first script code injected into the page to be accessed, a search result, i.e., a search failure result, may be automatically sent to the server, where the search failure result includes the URL of the page to be accessed.
In the second mode, if the login information input box cannot be found in the page to be accessed, a second plug-in is obtained, wherein a second search logic indicated by a second script code of the second plug-in is matched with the login information input box of the page to be accessed; injecting a second script code of the second plug-in into the page to be accessed through the browser; and searching the login information input box in the page to be accessed through second searching logic indicated by the injected second script code.
Specifically, if the login information input box is not found through the first search logic indicated by the first script code injected into the page to be accessed, in addition to feeding back the search failure result to the server in the first manner, another plug-in (i.e., a second plug-in) may be automatically obtained, where the second script code of the second plug-in may also be a Js script code injected into the page to be accessed in advance. At this time, the login information input box can be successfully searched in the page to be accessed according to the second search logic indicated in the second script code.
It should be noted that, in the embodiment of the present invention, there are various reasons that the first plug-in fails to successfully find the login information input box in the page to be accessed, for example, a display position of the login information input box in the page to be accessed is changed, which may cause the first plug-in to fail to successfully find the login information input box; or the display position of the login information input box in the page to be accessed is changed due to the updating of the page to be accessed, so that the first plug-in cannot successfully find the login information input box. For the above problems, if the method in the prior art is used to continue to log in the information input box, the search logic of the browser needs to be modified, for example, the search algorithm of the browser for the account and the password needs to be modified, but modifying the search algorithm of the browser itself is cumbersome in the past, and the kernel itself of the browser needs to be modified. Therefore, by adopting the second mode in the embodiment of the invention, the step of modifying the search algorithm can be omitted, the second plug-in can be directly obtained, and the login information input box can be successfully obtained through the second plug-in, so that the problem that the login information input box cannot be obtained by adopting the method in the prior art when the display position of the login information input box in the page to be accessed is changed is solved.
Further, if the login information input box is not found by the first search logic indicated by the first script code injected into the page to be accessed, the steps in the first mode and the second mode can be executed simultaneously in addition to the steps in the first mode and the second mode. That is, if the login information input box is not successfully found through the first script code, the result of the failed search may be fed back to the server, and meanwhile, the second plug-in may be obtained while being fed back to the server, so that the login information input box is continuously found through the second search logic indicated by the second script code of the second plug-in.
An embodiment of the present invention will be described below with reference to fig. 3 and 4. Assume that for logging into the "page a" web page, the location of the login information entry box (i.e., the login page a account dialog box in fig. 3) in "page a" is the location as shown in fig. 3 at a time in which "page a" is logged in. However, "page a" is updated with an upgrade, and at this time, the location of the login information input box (i.e., the login page a account dialog box in fig. 3) in "page a" is the location as shown in fig. 4. If the login information input box is searched through the first plug-in when the account of the page A is logged in the page shown in FIG. 4, the input box cannot be successfully searched, wherein the login information input box can be successfully searched in the page shown in FIG. 3 through the first plug-in. At this time, it is necessary to obtain a second plug-in, which can successfully find the login information input box in the page as shown in fig. 4 and display the login information in the login information input box.
Optionally, the step S2041 of searching the login information input box in the page to be accessed through the first search logic indicated by the injected first script code includes the following steps:
step S20411, a first input element with a password type is searched for in the page to be accessed.
Step S20412, a second input element adjacent to the first input element is searched for in the page to be accessed, where the type of the second input element is an account type, a position of the second input element in the page to be accessed is before a position of the first input element in the page to be accessed, and the second input element is a visible input element in a visible area of the page to be accessed.
Step S20413, if the first input element and the second input element are found, using the login information input box represented by the first input element and the second input element as the found login information input box.
Further, searching for a second input element adjacent to the first input element in the page to be accessed includes: and searching a second input element from the position of the first input element in the page to be accessed, and taking the searched first second input element as a second input element adjacent to the first input element.
Specifically, all input elements in the page to be accessed may be sequentially searched through a first search logic indicated by the injected first script code, then an input element with a type of "password" is sequentially found in the input element list, and the found element is used as a candidate seed, where the input element with the type of "password" is the first input element with the type of password.
Next, the candidate seed of the first input element (i.e., the first input element) may be sequentially filtered, for example, to determine whether the type of the previous input element is an account type, and if the type of the previous input element is determined to be the account type, it may be continuously determined whether the input element is an input element visible in the visible area of the page to be accessed. And if the input element is judged to be the visible input element in the visible area of the page to be accessed, taking the input element as a second input element. If the input element is judged not to be the visible input element in the visible area of the page to be accessed, whether the type of the previous input element of the input element is the account type or not is continuously judged, and whether the previous input element of the input element is visible in the visible area or not is judged until the judged input element not only belongs to the element of the account type, but also meets the condition that the input element is visible in the visible area.
To sum up, if it is first determined that an input element satisfies the following condition among elements preceding the first input element, the element is taken as a second input element, where the condition is: the type of the input element is an account type, the position of the input element in the page to be accessed is earlier than the position of the first input element in the page to be accessed, and the input element is a visible input element in a visible area of the page to be accessed. It should be noted that the account type may be any of the following types: text type, email type, tel type, number type.
In the process of searching for the second input element, several types of input elements are excluded, which are respectively: the input element is invisible in the visible area, or the input element is visible in the invisible area.
For example, some input elements are invisible to the user from the CSS style, that is, the account input box that we are looking for, i.e., the visible region is invisible. For example, display: none, visibility: hidden or accessibility: 0.
also, from the CSS style, the input element is visible, but it has been out of the document stream, and the coordinates are outside the visible area of the page, i.e. the type of input element is visible in the invisible area, so the type of input element needs to be excluded.
After the second input element adjacent to the first input element is obtained through screening, a one-step confirmation can be performed according to information such as id/name/class/[ attribute ] of the screened input element, and whether the second input element and the first input element are input elements which are wanted to be matched is confirmed. If the result is correct, the following step S4 may be executed, if all the candidate seeds are screened out, it may be because some special websites may not have account boxes, for example, the login page of the google website may store account names in cookies, and the account names are displayed as texts next time, and only prompt the user to fill in passwords; still alternatively, some of the password boxes are not standard input elements, and some of the pictures, for the user to select. If the browser is of the type described above, this can be handled by special recognition logic set by the developer. However, if the login information input box is not recognized by the special recognition logic, the following step S4 is executed.
Optionally, after the remaining input elements obtained after deleting the interfering input element are used as the login information input box, the method further includes step S4: and marking the path of the login information input box in the page to be accessed to obtain an input box mark, wherein the input box mark is used for judging whether the login information is displayed in the login information input box or not.
Specifically, after the login information input box is found, the path information of the login information input box in the page to be accessed may be marked, and the path information is recorded, so that the login information input box (i.e., the account/password box) can be quickly found for the login information to be filled in when the subsequent filling logic is executed, and the time for the user to log in the page is saved. After marking the path information, the find login information input box logic ends. It should be noted that, in the embodiment of the present invention, each time the login information input box is found, the path information of the login information input box may be marked, or the path information of one login information input box may be marked at each preset time according to a user requirement.
Optionally, after the login information of the page to be accessed and the login information input box of the page to be accessed are found through the first plug-in of the browser and displayed in the login information box, prompt information may be sent, where the prompt information is used to prompt whether to store the login information input by the user. Specifically, as shown in fig. 3, it is displayed in the upper right corner of the page to be accessed to see whether to store the password of the website, when the user clicks "store password", the login password of the user may be stored, and if the user clicks "this website is not prompted", the login password of the user may not be stored, and meanwhile, when the user logs in the page next time, the dialog box of "whether to store the password of the website" may not appear. Besides the two types of password saving and the website not being prompted, the user can be prompted whether to add the URL into a blacklist or not.
It should be noted that, if a user stores a plurality of accounts in a certain webpage, the user can manually switch among the accounts; the user can also manually trigger the logic of the stored and filled account number and the password without waiting for the automatic storage and filling of the system.
Furthermore, the method for acquiring login information provided by the invention can send the corresponding instruction to the background page of the page to be accessed according to the selection of the user in the prompt box, and further determine whether to store the data of the user or add the URL of the page into the blacklist through the background page. Meanwhile, when a user browses a webpage in the same browser, synchronization in multiple computers can be achieved. For example, if a user logs in the page a through a browser a in the computer 1 and records an account and a password, the login account and the password of the user can be automatically displayed in the computer 2 when the user logs in the page a through the browser a in the computer 2.
Further, the login information (i.e., login account and password) saved by the user, or the blacklist data, can be freely modified in the setting page of the browser, and the account helper function is enabled/disabled, and the data information is synchronized, which can be configured in the setting page. Specifically, in the interface shown in fig. 5, the user can freely set the "kernel mode", set the "security and privacy", set the "password and form", and the like. The user may also modify the account number and password saved by the user in the interface shown in fig. 6.
In a specific embodiment, the method for obtaining login information may be applied to a browser, so that when a user accesses a web page in the browser, a login account and a password (i.e., the login information) may be automatically displayed for the user. For example, a user a accesses a page a through a certain browser, when the user wants to log in the page, the login information of the user a on the page to be accessed can be searched in the historical login information recorded by the browser through a first script code of a first plug-in installed in the browser, and a login information input box is searched through a first search logic indicated by a first script code, if the login information input box is searched, the searched login information is input into the login information input box, and the login information input box for inputting the login information is displayed in the page to be accessed, wherein the displayed page is as shown in fig. 3. If the login information input box is not found, the position of the login information input box in the page to be accessed is changed, and at the moment, a search failure result for indicating the URL of the page to be accessed can be sent to the server; the second plug-in can also be obtained, the login information input box is searched through the second script code in the second plug-in, and after the login information input box is searched through the second script code, the searched login information can be input into the login information input box.
Fig. 7 is a flowchart of an optional method for acquiring login information according to an embodiment of the present invention, and as shown in fig. 7, the method for acquiring login information mainly includes the following steps S702 to S716:
step S702, receiving an instruction of a user to access a page to be accessed.
Step S704, judging whether the user login information is in a blacklist, wherein if the user login information is judged not to be in the blacklist, executing step S706; and if the user login information is judged to be in the blacklist, ending the process. After receiving an instruction to access a page to be accessed, it may be determined whether the user is in a blacklist.
Step S706, searching the user login information and the login information input box. If the user is judged not to be in the blacklist, the login information can be searched through the first script code, and the login information input box is searched according to the first searching logic indicated by the first script code.
When a user logs in a page to be accessed, the browser injects a first script code in the first plug-in into the page to be accessed, and then searches user login information of the page to be accessed in historical login information recorded by the browser through the first script code, wherein the first script code can be the Js script code. The method for searching for the login information input box through the first search logic is described in detail in the above step S20411 to step S20413, and is not described herein again.
Step S708, judging whether the user login information is found, wherein if the user login information input box and the login information are not found, executing step S710; if the user login information input box is found, step S712 or step S714 is performed.
Step S710, executing a logic for filling in user login information. Specifically, if the login information of the user is not found, the user may be prompted to manually input the login information in the login information input box, that is, step S712 is performed, and after the user manually fills in the login information, step S714 is performed, that is, login is performed according to the filled login information. After logging in according to the filled-in login information, the user can be prompted whether to store the current login information or not, and whether to list the login information in a blacklist or not can be prompted.
In step S712, a manual operation by the user is performed. If it is determined in step S708 that the user login information is found, the found login information may be directly input to the found login information input box. If the login information is found, the user can switch the account through manual operation, and the switched account logs in the page to be accessed. After the user switches the login account (i.e., the login information), the user may be prompted whether to save the current login account, or whether to list the login account in a blacklist.
Step S714, the above login information is logged in the page to be accessed.
Step S716, saving the user login information or blacklisting the user login information.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
According to an embodiment of the present invention, there is further provided an apparatus for acquiring login information, which is used for implementing the method for acquiring login information, and the apparatus for acquiring login information is mainly used for executing the method for acquiring login information provided in the foregoing description of the embodiment of the present invention, and the apparatus for acquiring login information provided in the embodiment of the present invention is described in detail below:
fig. 8 is a schematic diagram of an apparatus for acquiring login information according to an embodiment of the present invention, and as shown in fig. 8, the apparatus for acquiring login information mainly includes:
the receiving unit 81 is configured to receive a page access request in the browser, where the page access request includes a URL of a page to be accessed.
In the embodiment of the present invention, the page to be accessed may be a page to which a login account needs to be input. The page access request received in the browser may be a request to log into the page, for example, a request to log into page a, a request to log into a web portal, etc. For example, when a user requests to log in a page of page a, after a point of any browser hits the page of page a, there is a "login" in the upper left corner of the page displayed at the present time, and when the user clicks the "login" identifier, an account and password input box is displayed. The input box is a login information input box of the page to be accessed, wherein if the user does not log in the page for the first time, an account and a password of the user logged in last time may be displayed in the input box, and if the user logs in the page for the first time, the input box prompts the user to input the account and the password.
And the searching unit 83 is used for searching the login information of the page to be accessed and the login information input box of the page to be accessed through the first plug-in of the browser.
In the embodiment of the invention, the login information of the page to be accessed and the login information input box of the page to be accessed can be searched by the first plug-in arranged in the browser. The first plug-in may be a plug-in developed by a technician for acquiring a login information number and a login information input box, and the plug-in may be installed in any one browser.
And a display unit 85 for displaying the login information in the login information input box if the login information and the login information input box are found.
Assuming that the first plug-in finds the login information and the login information input box of the user in the "page a", the login information may be displayed in the login information input box, specifically, as shown in fig. 3, the login information input box is displayed in the page of the page a, wherein the login information input box includes a login account "test" and a login password, and the login password is hidden and displayed.
In the embodiment of the invention, the login information and the login information input box of the page to be accessed are searched through the first plug-in, wherein the login information is displayed in the login information input box under the condition that the login information and the login information input box are searched, and compared with a browser which is not provided with the function of automatically searching the login information and the login information input box in the prior art, the purpose that the login information and the login information input box can be obtained through the first plug-in is achieved, so that the technical effect of accelerating the display speed of the login information input box and the login information is realized, and the technical problem that the login information input box and the login information cannot be obtained due to the fact that a part of browsers are not provided with the function of obtaining the login information and the login information input box in the prior art is solved.
Optionally, the lookup unit includes: the injection module is used for injecting the first script code of the first plug-in into the page to be accessed through the browser; the first searching module is used for searching the login information of the page to be accessed in the historical login information recorded by the browser through the injected first script code; and the second searching module is used for searching the login information input box in the page to be accessed through the first searching logic indicated by the injected first script code.
Optionally, the apparatus further comprises: the sending unit is used for sending a search failure result to the server if the login information input box cannot be searched in the page to be accessed after the login information input box is searched in the page to be accessed through the first search logic indicated by the injected first script code, wherein the search result is used for indicating the URL; and/or the obtaining unit is used for obtaining a second plug-in under the condition that the login information input box cannot be found in the page to be accessed, wherein a second searching logic indicated by a second script code of the second plug-in is matched with the login information input box of the page to be accessed; injecting a second script code of the second plug-in into the page to be accessed through the browser; and searching the login information input box in the page to be accessed through second searching logic indicated by the injected second script code.
Optionally, the second lookup module includes: the first searching submodule is used for searching a first input element with the type being a password type in a page to be accessed; the second searching submodule is used for searching a second input element adjacent to the first input element in the page to be accessed, wherein the type of the second input element is an account number type, the position of the second input element in the page to be accessed is more front than the position of the first input element in the page to be accessed, and the second input element is a visible input element in a visible area of the page to be accessed; and the determining submodule is used for taking the login information input boxes represented by the first input element and the second input element as the searched login information input boxes under the condition that the first input element and the second input element are searched.
Optionally, the first lookup sub-module is configured to: and searching a second input element from the position of the first input element in the page to be accessed, and taking the searched first second input element as a second input element adjacent to the first input element.
Optionally, the apparatus further comprises: and the marking unit is used for marking the path of the login information input box in the page to be accessed after the residual input elements obtained after the interference input elements are deleted are taken as the login information input box, so as to obtain an input box mark, wherein the input box mark is used for judging whether the login information is displayed in the login information input box or not.
Example 3
According to an embodiment of the present invention, there is also provided a terminal (server) for implementing the above-mentioned method for acquiring login information, as shown in fig. 9, the terminal (server) mainly includes a processor 901, a display 902, a data interface 903, a memory 904, and a network interface 905, where:
the display 902 is mainly used to display login information and login information input boxes.
The data interface 903 transmits the login information input by the user to the processor 901 mainly by means of data transmission.
The memory 904 is mainly used for storing login information input by a user, such as a login account and a login password.
The network interface 905 is mainly used for performing network communication with a server, and providing data support for obtaining login information.
The processor 901 is mainly configured to perform the following operations:
receiving a page access request in a browser, wherein the page access request comprises a URL (uniform resource locator) of a page to be accessed; searching login information of a page to be accessed and a login information input box of the page to be accessed through a first plug-in of a browser; and if the login information and the login information input box are found, displaying the login information in the login information input box.
The processor 901 is further configured to inject a first script code of the first plug-in into the page to be accessed through the browser; searching login information of a page to be accessed in historical login information recorded by a browser through the injected first script code; and searching the login information input box in the page to be accessed through the first searching logic indicated by the injected first script code.
The processor 901 is further configured to, after searching for the login information input box in the page to be accessed through the first search logic indicated by the injected first script code, send a search failure result to the server if the login information input box cannot be searched in the page to be accessed, where the search failure result is used to indicate a URL; and/or if the login information input box cannot be found in the page to be accessed, acquiring a second plug-in, wherein a second search logic indicated by a second script code of the second plug-in is matched with the login information input box of the page to be accessed; injecting a second script code of the second plug-in into the page to be accessed through the browser; and searching the login information input box in the page to be accessed through second searching logic indicated by the injected second script code.
The processor 901 is further configured to search a first input element with a password type in the page to be accessed; searching a second input element adjacent to the first input element in the page to be accessed, wherein the type of the second input element is an account number type, the position of the second input element in the page to be accessed is more front than the position of the first input element in the page to be accessed, and the second input element is a visible input element in a visible area of the page to be accessed; and if the first input element and the second input element are found, using the login information input boxes represented by the first input element and the second input element as the found login information input boxes.
The processor 901 is further configured to search a second input element from the position of the first input element in the page to be accessed, and use the searched first second input element as a second input element adjacent to the first input element.
The processor 901 is further configured to mark a path of the login information input box in the page to be accessed after the remaining input elements obtained after the interference input elements are deleted are taken as the login information input box, so as to obtain an input box mark, where the input box mark is used to determine whether to display the login information in the login information input box.
Optionally, the specific examples in this embodiment may refer to the examples described in embodiment 1 and embodiment 2, and this embodiment is not described herein again.
Example 4
The embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the storage medium may be configured to store a program code of the method for acquiring login information according to the embodiment of the present invention.
Optionally, in this embodiment, the storage medium may be located in at least one of a plurality of network devices in a network of a mobile communication network, a wide area network, a metropolitan area network, or a local area network.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
s1, receiving a page access request in the browser, wherein the page access request comprises a URL of a page to be accessed;
s2, searching the login information of the page to be accessed and the login information input box of the page to be accessed through the first plug-in of the browser;
and S3, if the login information and the login information input box are found, displaying the login information in the login information input box.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Optionally, the specific examples in this embodiment may refer to the examples described in embodiment 1 and embodiment 2, and this embodiment is not described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (8)

1. A method for acquiring login information is characterized by comprising the following steps:
receiving a page access request in a browser, wherein the page access request comprises a URL (uniform resource locator) of a page to be accessed;
injecting a first script code of a first plug-in into the page to be accessed through the browser;
searching the login information of the page to be accessed in the historical login information recorded by the browser through the injected first script code;
searching the login information input box in the page to be accessed through first searching logic indicated by the injected first script code;
if the login information input box cannot be found in the page to be accessed, a second plug-in is obtained, wherein a second search logic indicated by a second script code of the second plug-in is matched with the login information input box of the page to be accessed; injecting a second script code of the second plug-in into the page to be accessed through the browser; searching the login information input box in the page to be accessed through the second search logic indicated by the injected second script code;
if the login information and the login information input box are found, displaying the login information in the login information input box;
marking the path information of the login information input box in the page to be accessed, and recording the path information into an input box mark, wherein the input box mark is used for searching the login information input box of the page to be accessed when filling logic is executed, and after the path information is marked, the first search logic or the second search logic is finished.
2. The method according to claim 1, wherein the searching the login information input box in the page to be accessed through the first search logic indicated by the injected first script code comprises:
searching a first input element with the type being a password type in the page to be accessed;
searching a second input element adjacent to the first input element in the page to be accessed, wherein the type of the second input element is an account number type, the position of the second input element in the page to be accessed is before the position of the first input element in the page to be accessed, and the second input element is a visible input element in a visible area of the page to be accessed;
if the first input element and the second input element are found, using the login information input box represented by the first input element and the second input element as the found login information input box.
3. The method of claim 2, wherein finding a second input element adjacent to the first input element in the page to be accessed comprises:
and searching the second input element from the position of the first input element in the page to be accessed, and taking the first searched second input element as a second input element adjacent to the first input element.
4. An apparatus for acquiring login information, comprising:
the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a page access request in a browser, and the page access request comprises a URL (uniform resource locator) of a page to be accessed;
the searching unit comprises an injection module, a searching module and a judging module, wherein the injection module is used for injecting a first script code of a first plug-in into the page to be accessed through the browser; the first searching module is used for searching the login information of the page to be accessed in the historical login information recorded by the browser through the injected first script code; the second searching module is used for searching the login information input box in the page to be accessed through the first searching logic indicated by the injected first script code;
the obtaining unit is used for obtaining a second plug-in unit under the condition that the login information input box cannot be found in the page to be accessed, wherein a second searching logic indicated by a second script code of the second plug-in unit is matched with the login information input box of the page to be accessed; injecting a second script code of the second plug-in into the page to be accessed through the browser; searching the login information input box in the page to be accessed through the second search logic indicated by the injected second script code
The display unit is used for displaying the login information in the login information input box under the condition that the login information and the login information input box are found;
and the marking unit is used for marking the path information of the login information input box in the page to be accessed and recording the path information into an input box mark, wherein the input box mark is used for searching the login information input box of the page to be accessed when filling logic is executed, and after the path information is marked, the first searching logic or the second searching logic is finished.
5. The apparatus of claim 4, wherein the second lookup module comprises:
the first searching submodule is used for searching a first input element with the type being a password type in the page to be accessed;
a second search sub-module, configured to search, in the page to be accessed, a second input element adjacent to the first input element, where a type of the second input element is an account type, a position of the second input element in the page to be accessed is before a position of the first input element in the page to be accessed, and the second input element is a visible input element in a visible area of the page to be accessed;
and the determining submodule is used for taking the login information input boxes represented by the first input element and the second input element as the searched login information input boxes under the condition that the first input element and the second input element are searched.
6. The apparatus of claim 5, wherein the first lookup submodule is configured to:
and searching the second input element from the position of the first input element in the page to be accessed, and taking the first searched second input element as a second input element adjacent to the first input element.
7. A computer-readable storage medium, in which a computer program is stored, which computer program, when running, performs the method of any one of claims 1 to 3.
8. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 3 by means of the computer program.
CN201610310776.2A 2016-05-11 2016-05-11 Method and device for acquiring login information Active CN105956136B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610310776.2A CN105956136B (en) 2016-05-11 2016-05-11 Method and device for acquiring login information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610310776.2A CN105956136B (en) 2016-05-11 2016-05-11 Method and device for acquiring login information

Publications (2)

Publication Number Publication Date
CN105956136A CN105956136A (en) 2016-09-21
CN105956136B true CN105956136B (en) 2020-08-11

Family

ID=56911446

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610310776.2A Active CN105956136B (en) 2016-05-11 2016-05-11 Method and device for acquiring login information

Country Status (1)

Country Link
CN (1) CN105956136B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107357562B (en) * 2017-05-24 2023-09-05 青岛海信移动通信技术股份有限公司 Information filling method, device and client
CN107733847B (en) * 2017-07-25 2020-06-09 深圳壹账通智能科技有限公司 Method and device for platform login website, computer equipment and readable storage medium
CN107547518B (en) * 2017-07-25 2020-06-05 新华三大数据技术有限公司 Method and device for hiding front-end password
CN111209587B (en) * 2019-12-24 2022-04-22 杭州安恒信息技术股份有限公司 One-key login method based on js browser plug-in
CN112261005B (en) * 2020-09-27 2022-12-06 中孚安全技术有限公司 Method and system for hiding Web secure login password
CN116301456A (en) * 2023-02-21 2023-06-23 广州市保伦电子有限公司 Windows client login test management method, device and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101997685A (en) * 2009-08-27 2011-03-30 阿里巴巴集团控股有限公司 Single sign-on method, single sign-on system and associated equipment
CN103268331A (en) * 2011-11-21 2013-08-28 北京奇虎科技有限公司 Automatic login method and automatic login device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101997685A (en) * 2009-08-27 2011-03-30 阿里巴巴集团控股有限公司 Single sign-on method, single sign-on system and associated equipment
CN103268331A (en) * 2011-11-21 2013-08-28 北京奇虎科技有限公司 Automatic login method and automatic login device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
lastpass-优秀的网络密码帐号管理工具(自动登录/同步/跨平台/浏览器插件);异次元;《异次元网站》;20111227;第1-13页 *

Also Published As

Publication number Publication date
CN105956136A (en) 2016-09-21

Similar Documents

Publication Publication Date Title
CN105956136B (en) Method and device for acquiring login information
US10498847B2 (en) System and method for mobile application deep linking
US9747117B2 (en) System and methods for loading an application and its modules in a client device
CN106911693B (en) Method and device for detecting hijacking of webpage content and terminal equipment
US9223895B2 (en) System and method for contextual commands in a search results page
CN108366058B (en) Method, device, equipment and storage medium for preventing traffic hijacking of advertisement operator
US10095798B2 (en) Method for displaying website authentication information and browser
CN107291759B (en) Method and device for processing browser page resources
CN107528718B (en) Method, device and system for acquiring resources
EP2987088A2 (en) Client side page processing
US20160034118A1 (en) Determining appropriate browsing applications for selected network resources
CN102968584B (en) A kind of method and apparatus of log-on webpage
US10943063B1 (en) Apparatus and method to automate website user interface navigation
KR20140111265A (en) Method and apparatus for providing web pages
CN109522500B (en) Webpage display method, device, terminal and storage medium
CN110941779B (en) Page loading method and device, storage medium and electronic equipment
CN103078945A (en) Method and system for processing browser crash data
CN102938766A (en) Vicious website prompt method and device
US8140508B2 (en) System and method for contextual commands in a search results page
US20180210867A1 (en) System and method for displaying online comments
CN102946391A (en) Method for prompting malicious website in browser and browser
CN108494728B (en) Method, device, equipment and medium for creating blacklist library for preventing traffic hijacking
CN108062352B (en) Webpage page caching processing method, mobile terminal equipment and medium product
US10095791B2 (en) Information search method and apparatus
CN113326418A (en) Method and device for determining webpage information source and webpage quality

Legal Events

Date Code Title Description
C06 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