CN113779438A - Webpage text information processing method and device and terminal equipment - Google Patents

Webpage text information processing method and device and terminal equipment Download PDF

Info

Publication number
CN113779438A
CN113779438A CN202110967302.6A CN202110967302A CN113779438A CN 113779438 A CN113779438 A CN 113779438A CN 202110967302 A CN202110967302 A CN 202110967302A CN 113779438 A CN113779438 A CN 113779438A
Authority
CN
China
Prior art keywords
text information
target
monitoring event
character
triggered
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.)
Pending
Application number
CN202110967302.6A
Other languages
Chinese (zh)
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.)
Shenzhen Valueonline Technology Co ltd
Original Assignee
Shenzhen Valueonline Technology 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 Shenzhen Valueonline Technology Co ltd filed Critical Shenzhen Valueonline Technology Co ltd
Priority to CN202110967302.6A priority Critical patent/CN113779438A/en
Publication of CN113779438A publication Critical patent/CN113779438A/en
Pending legal-status Critical Current

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/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • 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
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • 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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation

Abstract

The application is applicable to the technical field of information processing, and provides a method, a device and a terminal device for processing text information of a webpage, wherein the method comprises the following steps: acquiring target text information of a webpage; each character in the target text information is provided with a monitoring event; and when detecting that the monitoring event corresponding to at least one character is triggered, marking the target character of the triggered monitoring event. According to the method for processing the text information of the webpage, when the monitoring event of the plurality of discontinuous characters is triggered, the plurality of discontinuous characters can be marked at the same time, and the processing efficiency of the text information is improved.

Description

Webpage text information processing method and device and terminal equipment
Technical Field
The present application belongs to the field of information processing technologies, and in particular, to a method and an apparatus for processing text information of a web page, a terminal device, and a computer-readable storage medium.
Background
At present, people can browse web page information provided by various websites through the internet to obtain contents which are needed or interested by themselves, such as news information, leisure and entertainment, professional knowledge and the like. Meanwhile, when browsing web page information, when browsing content that is needed or interesting, people usually need to perform further processing on the content, such as highlighting.
However, in the conventional method for processing text information of a web page, only continuous text contents in the text information of the web page can be processed, and when a plurality of selected text contents need to be processed, only after the selected text contents at one place are processed, the next text contents can be processed. Therefore, the conventional method for processing the text information of the webpage cannot process certain discontinuous text information in a targeted manner, and has the problem of low processing efficiency.
Disclosure of Invention
The embodiment of the application provides a method and a device for processing text information of a webpage, terminal equipment and a computer readable storage medium, and can solve the problems that in the prior art, some discontinuous text information cannot be processed in a targeted manner, and the processing efficiency is low.
In a first aspect, an embodiment of the present application provides a method for processing text information of a web page, including:
acquiring target text information of a webpage; each character in the target text information is provided with a monitoring event;
and when detecting that the monitoring event corresponding to at least one character is triggered, marking the target character triggered to the monitoring event.
Optionally, the acquiring text information of the web page includes:
acquiring initial text information of the webpage;
and carrying out first preset operation on a first preset label of the initial text information to obtain the target text information.
Optionally, the performing a first preset operation on a first preset tag of the initial text information to obtain the target text information includes:
performing a first preset operation on a first preset label of the initial text information to obtain second text information;
splitting the second text information to obtain a plurality of initial characters;
configuring a second preset label for each initial character to obtain a label character configured with the second preset label;
configuring identification information for the label characters based on a preset requirement to obtain identification characters;
and setting the monitoring event for each identification character to obtain the target text information.
Optionally, when it is detected that the monitoring event corresponding to at least one text is triggered, the marking process is performed on the target text which is triggered to the monitoring event, and includes:
when detecting that the monitoring event corresponding to at least one character is triggered, acquiring target identification information of the triggered monitoring event;
and determining a target character corresponding to the target identification information according to the target identification information and the document object model, and marking the target character.
Optionally, when it is detected that the monitoring event corresponding to at least one text is triggered, after the target text triggering the monitoring event is marked, the method further includes:
storing the target identification information to a character database based on a preset order.
Optionally, the snoop event includes a first snoop event and a second snoop event; when detecting that at least one monitoring event is triggered, the marking processing of the target words triggered by the monitoring event includes:
and when the first monitoring event and the second monitoring event are both triggered, marking the target characters of the triggered monitoring event.
Optionally, when it is detected that the monitoring event corresponding to at least one text is triggered, the marking process is performed on the target text which is triggered to the monitoring event, and includes:
when the monitoring event corresponding to at least one character is triggered, responding to a character processing instruction, and determining a target processing mode of the target character according to the character processing instruction;
and marking the target characters according to the target processing mode.
In a second aspect, an embodiment of the present application provides a text information processing apparatus for a web page, including:
the first acquisition unit is used for acquiring target text information of a webpage; each character in the target text information is provided with a monitoring event;
the first processing unit is used for marking the target character which is triggered to the monitoring event when the monitoring event corresponding to at least one character is triggered.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the text information processing method for a web page according to any one of the above first aspects when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the text information processing method for a web page according to any one of the above first aspects.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a terminal device, enables the terminal device to execute the text information processing method for a web page according to any one of the above first aspects.
Compared with the prior art, the embodiment of the application has the advantages that:
according to the method for processing the text information of the webpage, the monitoring event is set for each character in the acquired text information of the webpage, so that when the monitoring event corresponding to at least one character is triggered, at least one target character of the triggered monitoring event can be marked at the same time. That is to say, the method provided by the embodiment of the present application can perform marking processing on multiple discontinuous words at the same time when detecting that a listening event of the multiple discontinuous words is triggered, thereby improving the processing efficiency of text information.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a flowchart illustrating an implementation of a method for processing text information of a web page according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating an implementation of a method for processing text information of a web page according to an embodiment of the present application;
fig. 3 is a processing effect diagram of a method for processing text information of a web page according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating an implementation of a method for processing text information of a web page according to another embodiment of the present application;
FIG. 5 is a flowchart illustrating an implementation of a method for processing text information of a web page according to yet another embodiment of the present application;
FIG. 6 is a flowchart illustrating an implementation of a method for processing text information of a web page according to another embodiment of the present application;
FIG. 7 is a schematic structural diagram of a text information processing apparatus for a web page according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of a method for processing text information of a web page according to an embodiment of the present application. An execution main body of the webpage text information processing method provided by the embodiment of the application is terminal equipment. The terminal device can be a smart phone, a tablet computer or a desktop computer.
As shown in fig. 1, the method for processing text information of a web page according to an embodiment of the present application may include steps S101 to S102, which are detailed as follows:
in S101, acquiring target text information of a webpage; and each character in the target text information is provided with a monitoring event.
In the embodiment of the present application, the web page may be any web page including text provided by any website. The web page may be a web page written in hypertext Markup Language (HTML), and may be a web page written in other languages.
In an implementation manner of the embodiment of the present application, the terminal device may acquire target text information obtained after processing the initial text information of the web page from other devices. The initial text information refers to the text information in the default state in the webpage. The other devices may be terminal devices, or may be other terminal devices.
In an implementation manner of the embodiment of the application, the terminal device may process the input initial text information in advance to obtain the target text information, and when the terminal device needs to process the text information of the web page, the terminal device directly obtains the target text information from the terminal device.
Based on this, in an embodiment of the present application, the terminal device may specifically obtain the target text information through steps S201 to S202 shown in fig. 2, which are detailed as follows:
in S201, initial text information of the web page is acquired.
In S202, a first preset operation is performed on a first preset tag of the initial text information to obtain the target text information.
In this embodiment, when a user wants to process text information of a certain webpage, a second preset operation for processing the text information of the webpage may be triggered. The second preset operation may be set according to actual needs, and is not limited herein. For example, the second preset operation may be clicking a first preset control, that is, if the terminal device detects that the user clicks the first preset control of a certain webpage, it is determined that the second preset operation for processing the text information of the webpage is detected.
And after detecting the second preset operation, the terminal equipment can acquire the initial text information of the webpage.
In practical application, because the initial text information of the web page carries the first preset tag, and the web page can realize some basic processing functions (such as copying, web page searching and the like) through the first preset tag, in order to avoid mutual interference between the basic processing function carried by the web page and the text information processing method of the web page provided by the embodiment of the application, the terminal device can perform the first preset operation on the first preset tag of the initial text information of the web page, so as to obtain the target text information of the web page.
The first preset tag may be determined according to actual needs, and is not limited herein, for example, the web page is written in HTML, and the first preset tag may be a partition (div) tag.
The first preset operation may be set according to actual needs, and is not limited herein, for example, the first preset operation may be to add a certain attribute to the first preset tag, so as to achieve the purpose of shielding the basic processing function of the web page.
In the embodiment of the application, since each character in the target character information is provided with the monitoring event, the terminal device can detect whether the monitoring event of each character in the target character information is triggered or not in real time. When the terminal device detects that a listening event corresponding to at least one text in the target text information is triggered, step S102 may be executed.
In an implementation manner of the embodiment of the present application, when the terminal device is a desktop computer or a notebook computer, the monitoring event may be a mouse monitoring event or a keyboard monitoring event.
In another implementation manner of the embodiment of the application, when the terminal device is an intelligent terminal, the monitoring event may be a preset touch screen event. The preset touch event can be set according to actual needs, and is not limited here.
In S102, when it is detected that the monitoring event corresponding to at least one text is triggered, a target text that triggers the monitoring event is marked.
In the embodiment of the application, when detecting that a monitoring event corresponding to at least one word in target text information of a webpage is triggered, the terminal device indicates that the terminal device needs to process the at least one word, and therefore the terminal device can mark the target word of the triggered monitoring event.
In practical applications, taking a monitoring event as a mouse monitoring event as an example, when a user browses text information of a certain webpage through a browser on a desktop computer or a notebook, the user may use the mouse to perform other operations, such as operations of moving the mouse up and down to browse the text information of the webpage.
Therefore, in order to improve the accuracy of the terminal device in processing the text information of the webpage, in an embodiment of the present application, the listening event may include a first listening event and a second listening event. The first monitoring event may be a mouse-over event, and the second monitoring event may be a mouse-click event. The mouse click event may be a mouse click event, and the mouse click event may be a left mouse click event or a right mouse click event.
Therefore, when the terminal device detects that both the first monitoring event and the second monitoring event are triggered, the target character needs to be processed, and therefore the terminal device marks the target character.
It can be understood that when the terminal device detects that the mouse hover event and the mouse click event corresponding to the target word are triggered at the same time, it indicates that the target word needs to be processed, and therefore, the terminal device performs the marking process on the target word.
It should be noted that the marking process performed by the terminal device on the target text triggered to the listening event may be to copy the target text, or to change the style of the target text.
Wherein, the changing the style of the target text includes but is not limited to: changing the background color of the target character, changing the font color of the target character and/or changing the font size of the target character, etc.
In another embodiment of the present application, after the terminal device marks the target text, the terminal device may further store the target text into the text database based on a preset sequence, so that a subsequent terminal device may perform other processing, such as copying, on the target text.
The preset sequence may be determined according to actual needs, and is not limited herein, and for example, the preset sequence may be: the time sequence of the triggered monitoring events of the target characters.
For example, referring to fig. 3, taking the marking process as an example of changing the style of the target text, fig. 3 is a processing effect diagram of the text information of the web page obtained after the terminal device executes steps S101 to S102 to mark the selected multiple texts (change the font size of the target text).
As can be seen from the above, in the method for processing text information of a web page provided by the embodiment of the present application, since each character in the obtained text information of the web page is provided with a monitoring event, when it is detected that a monitoring event corresponding to at least one character is triggered, at least one target character of the triggered monitoring event can be marked at the same time. That is to say, the method provided by the embodiment of the present application can perform marking processing on multiple discontinuous words at the same time when detecting that a listening event of the multiple discontinuous words is triggered, thereby improving the processing efficiency of text information.
Referring to fig. 4, fig. 4 is a flowchart illustrating an implementation of a method for processing text information of a web page according to another embodiment of the present application. With respect to the embodiment corresponding to fig. 2, in the method for processing text information of a web page provided in this embodiment, S202 may specifically include S301 to S305, which are detailed as follows:
in S301, a first preset operation is performed on a first preset tag of the initial text information to obtain second text information.
In S302, the second text information is split to obtain a plurality of initial characters.
In S303, a second preset tag is configured for each initial character, so as to obtain a tag character configured with the second preset tag.
In S304, configuring identification information for the label text based on a preset requirement to obtain an identification text.
In S305, the monitoring event is set for each of the identification words, so as to obtain the target text information.
In this embodiment, because the second text information is still a continuous text string, in order to ensure that each character in the text information of the web page is provided with a monitoring event, the terminal device may split the second text information to obtain the initial character. Wherein the initial character, i.e. the single character, is an individual.
In order to ensure that the second text message is split, the terminal device may configure a second preset tag for each initial word in the second text message, so as to obtain a plurality of tag words carrying the second preset tag.
The second preset tag can be set according to actual needs, and is not limited here. The second preset label is different from the first preset label.
Taking the example of the web page written in HTML, the second preset Tag may be an in-line Tag (Span Tag).
In practical application, because a text message of a web page has a situation that one word appears for many times, in order to clarify a target word to be marked and improve the processing accuracy of the terminal device, the terminal device may configure one identification information for each tag word based on a preset requirement, thereby obtaining the identification word carrying the identification information.
It should be noted that the preset requirement may be: the ordering of the label words with respect to all label words in the second text information. Based on this, the identification information may be a serial number.
It can be understood that, namely, the terminal device may determine the sequence of the tag words with respect to all the tag words in the second text information as the identification information of the tag words, and configure the identification information to the tag words, thereby obtaining the identification words carrying the identification information.
For example, assuming that a certain tag word is ranked to the third position with respect to all tag words in the second text information, that is, the initial word corresponding to the tag word is located at the third position of all initial words in the second text information, the identification information corresponding to the tag word is 003.
Specifically, assuming that the initial word is a "test word", the label word corresponding to the initial word is "< span > to < span > word </span" ", and the identification word is" < span id ═ a01 "> to < span ═ a 02" > to < span ═ a03 "> to < span ═ a 04" > word </span "".
It should be noted that the identification information in the identification text is used to identify the second preset tag in the identification text.
In an embodiment of the application, after the terminal device obtains the identification words, the terminal device may further perform associated storage on the initial words and the identification information corresponding to the initial words.
After the terminal device obtains the identification words, a monitoring event can be set for each identification word, so that target text information can be obtained.
As can be seen from the above, in the text information processing method for a web page provided in this embodiment, a second text information is obtained by performing a first preset operation on a first preset tag of an initial text information; splitting the second text information to obtain a plurality of initial characters; configuring a second preset label for each initial character to obtain a label character configured with the second preset label; configuring identification information for the label characters based on preset requirements to obtain characters; and setting a monitoring event for each character to obtain target text information, so that each character of the target text information is provided with the monitoring event, therefore, the terminal equipment can detect whether the monitoring event of each character is triggered or not in real time, can detect whether the monitoring events of a plurality of discontinuous characters are triggered or not at the same time, and improves the processing efficiency of the terminal equipment on the text information of the webpage.
In yet another embodiment of the present application, each character in the target text information carries identification information, so please refer to fig. 5, where fig. 5 is a flowchart illustrating an implementation of a text information processing method for a web page according to yet another embodiment of the present application. With respect to the embodiment corresponding to fig. 4, in the method for processing text information of a web page provided in this embodiment, S202 may specifically include S401 to S402, which are detailed as follows:
in S401, when it is detected that the monitoring event corresponding to at least one text is triggered, target identification information of the triggered monitoring event is obtained.
In S402, determining a target word corresponding to the target identification information according to the target identification information and the document object model, and performing a labeling process on the target word.
In this embodiment, since one word may appear for multiple times and each word carries identification information, when detecting that a monitoring event corresponding to at least one word is triggered, the terminal device may obtain target identification information of the triggered monitoring event, and determine a target word corresponding to the target identification information according to the target identification information and the document object model, thereby determining which position of the word in the text information of the web page needs to be processed.
Document Object Model (DOM), a standard Application Programming Interface (API) that processes HTML files. The DOM provides an access model for the whole document, the document is used as a tree structure, and each node of the tree represents an HTML tag or a text item in the tag, so that the terminal device can determine the target characters corresponding to the target identification information according to the target identification information and the DOM.
After determining the target character, the terminal device may perform a marking process on the target character.
In an embodiment of the present application, after the terminal device marks the target text, the target identification information may be stored in the text database based on a preset sequence, so that subsequent terminal devices can process the target text corresponding to the target identification information, for example, copy the target text.
As can be seen from the above, in the text information processing method for a web page provided in this embodiment, when it is detected that a monitoring event corresponding to at least one character is triggered, target identification information of the triggered monitoring event is obtained; and determining a target character corresponding to the target identification information according to the target identification information and the document object model, and marking the target character, so that the terminal equipment can determine the specific position of the target character according to the identification information, thereby marking the target character at the specific position, avoiding the error processing of the character at the wrong position when a plurality of same characters exist, and further improving the processing accuracy of the terminal equipment.
Referring to fig. 6, fig. 6 is a flowchart illustrating an implementation of a method for processing text information of a web page according to another embodiment of the present application. With respect to the embodiment corresponding to fig. 1, in the method for processing text information of a web page provided in this embodiment, S102 may specifically include S501 to S502, which are detailed as follows:
in S501, when it is detected that the monitoring event corresponding to at least one word is triggered, a word processing instruction is responded, and a target processing manner of the target word is determined according to the word processing instruction.
In S502, the target characters are marked according to the target processing manner.
In this embodiment, the terminal device may detect the word processing instruction, and the terminal device detects the third preset operation. The third preset operation may be set according to actual needs, and is not limited herein. For example, the third preset operation may be clicking a second preset control, that is, if the terminal device detects that the user clicks the second preset control, it is determined that the third preset operation is detected, that is, the word processing instruction is detected.
It should be noted that the word processing instruction carries a processing mode corresponding to a word, and therefore, when the terminal device detects the word processing instruction, the terminal device may determine a target processing mode of the target word in response to the word processing instruction.
Target processing includes, but is not limited to, copying the target text and altering the style of the target text.
Wherein, the changing the style of the target text includes but is not limited to: changing the background color of the target character, changing the font color of the target character and/or changing the font size of the target character, etc.
Based on this, the second preset control may include a first functionality control and a second functionality control. The first function control is used for copying characters and the like, and the second function control is used for changing the character style.
The second function control may specifically include a background color control, a font size control, and the like. The background color control and the font color control both comprise color keys corresponding to each preset color. The preset color can be determined according to actual needs, and is not limited herein.
In this embodiment, when the user clicks any function control, the terminal device may detect a word processing instruction carrying a word processing mode corresponding to the function control, and therefore, the terminal device may determine a target processing mode in response to the word processing instruction, so as to perform mark processing on a target word according to the target processing mode.
As can be seen from the above, in the text information processing method for a web page provided in this embodiment, when a monitoring event corresponding to at least one word is detected to be triggered, a word processing instruction is responded, and a target processing mode of a target word is determined according to the word processing instruction; and marking the target characters according to the target processing mode, so that the terminal equipment not only can copy the target characters and other operations, but also can change the style of the target characters, and a user can mark the characters of the text information of the webpage according to the requirement.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 7 shows a block diagram of a text information processing apparatus of a web page provided in an embodiment of the present application, which corresponds to the text information processing method of a web page described in the above embodiment. Referring to fig. 7, text information processing apparatus 700 for the web page includes: a first acquisition unit 71 and a first processing unit 72. Wherein:
the first acquiring unit 71 is configured to acquire target text information of a web page; and each character in the target text information is provided with a monitoring event.
The first processing unit 72 is configured to, when it is detected that the monitoring event corresponding to at least one word is triggered, perform a marking process on a target word that is triggered by the monitoring event.
In an embodiment of the present application, the first obtaining unit 71 specifically includes: a second acquisition unit and a first operation unit. Wherein:
the second acquiring unit is used for acquiring initial text information of the webpage.
The first operation unit is used for performing first preset operation on a first preset label of the initial text information to obtain the target text information.
In an embodiment of the present application, the first operation unit specifically includes: the device comprises a second operation unit, a splitting unit, a first configuration unit, a second configuration unit and a setting unit. Wherein:
the second operation unit is used for performing first preset operation on a first preset label of the initial text information to obtain second text information.
The splitting unit is used for splitting the second text information to obtain a plurality of initial characters.
The first configuration unit is used for configuring a second preset label for each initial character to obtain the label characters configured with the second preset label.
The second configuration unit is used for configuring identification information for the label characters based on preset requirements to obtain the identification characters.
The setting unit is used for setting the monitoring event for each identification character to obtain the target text information.
In an embodiment of the present application, the first processing unit 72 specifically includes: a third acquisition unit and a second processing unit. Wherein:
the third obtaining unit is configured to obtain target identification information of the triggered monitoring event when it is detected that the monitoring event corresponding to at least one text is triggered.
And the second processing unit is used for determining a target character corresponding to the target identification information according to the target identification information and the document object model and marking the target character.
In one embodiment of the present application, the apparatus 700 for processing text information of a web page further includes: and a memory unit.
The storage unit is used for storing the target identification information to an alphanumeric database based on a preset sequence.
In one embodiment of the present application, the snoop events include a first snoop event and a second snoop event; the first processing unit 72 is specifically configured to: and when the first monitoring event and the second monitoring event are both triggered, marking the target characters of the triggered monitoring event.
In an embodiment of the present application, the first processing unit 72 specifically includes: a determination unit and a third processing unit. Wherein:
the determining unit is used for responding to a word processing instruction when detecting that the monitoring event corresponding to at least one word is triggered, and determining a target processing mode of the target word according to the word processing instruction.
And the third processing unit is used for marking the target characters according to the target processing mode.
As can be seen from the above, in the text information processing apparatus for a web page provided in the embodiment of the present application, since each character in the obtained text information of the web page is provided with a monitoring event, when it is detected that the monitoring event corresponding to at least one character is triggered, at least one target character of the triggered monitoring event can be marked at the same time. That is to say, the apparatus provided in the embodiment of the present application, when detecting that a listening event of multiple discontinuous texts is triggered, may perform marking processing on the multiple discontinuous texts at the same time, so as to improve processing efficiency of text information.
Fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 8, the terminal device 8 of this embodiment includes: at least one processor 80 (only one is shown in fig. 8), a memory 81, and a computer program 82 stored in the memory 81 and operable on the at least one processor 80, wherein the processor 80 executes the computer program 82 to implement the steps in any of the above-mentioned embodiments of the method for processing text information of a web page.
Those skilled in the art will appreciate that fig. 8 is merely an example of the terminal device 8, and does not constitute a limitation of the terminal device 8, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
The Processor 80 may be a Central Processing Unit (CPU), and the Processor 80 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 81 may in some embodiments be an internal storage unit of the terminal device 8, such as a hard disk or a memory of the terminal device 8. In other embodiments, the memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 8. Further, the memory 81 may also include both an internal storage unit and an external storage device of the terminal device 8. The memory 81 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 81 may also be used to temporarily store data that has been output or is to be output.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when being executed by a processor, the computer program may implement the steps in any one of the above-mentioned embodiments of the method for processing text information of a web page.
The embodiment of the present application provides a computer program product, which when running on a terminal device, enables the terminal device to implement the steps in any one of the above embodiments of the text information processing method for a web page when executed.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when being executed by a processor, the computer program may implement the steps in any one of the above-mentioned embodiments of the method for processing text information of a web page.
The embodiment of the present application provides a computer program product, which, when running on a terminal device, enables the terminal device to implement the steps in the text information processing method embodiment that can implement any one of the above-mentioned web pages when executed.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed text information processing apparatus and method for web pages may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or 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, devices or units, and may be in an electrical, mechanical 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.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for processing text information of a webpage is characterized by comprising the following steps:
acquiring target text information of a webpage; each character in the target text information is provided with a monitoring event;
and when detecting that the monitoring event corresponding to at least one character is triggered, marking the target character triggered to the monitoring event.
2. The method for processing text information of a web page according to claim 1, wherein the acquiring text information of a web page includes:
acquiring initial text information of the webpage;
and carrying out first preset operation on a first preset label of the initial text information to obtain the target text information.
3. The method for processing the text information of the web page according to claim 2, wherein the performing a first preset operation on a first preset tag of the initial text information to obtain the target text information comprises:
performing a first preset operation on a first preset label of the initial text information to obtain second text information;
splitting the second text information to obtain a plurality of initial characters;
configuring a second preset label for each initial character to obtain a label character configured with the second preset label;
configuring identification information for the label characters based on a preset requirement to obtain identification characters;
and setting the monitoring event for each identification character to obtain the target text information.
4. The method for processing the text information of the webpage according to claim 3, wherein when detecting that the monitoring event corresponding to at least one word is triggered, marking a target word which is triggered to the monitoring event comprises:
when detecting that the monitoring event corresponding to at least one character is triggered, acquiring target identification information of the triggered monitoring event;
and determining a target character corresponding to the target identification information according to the target identification information and the document object model, and marking the target character.
5. The method for processing text information of a web page according to claim 4, wherein after the step of marking the target word for which the monitoring event is triggered when the monitoring event corresponding to at least one word is detected to be triggered, the method further comprises:
storing the target identification information to a character database based on a preset order.
6. The method for processing the text information of the web page according to claim 1, wherein the listening event includes a first listening event and a second listening event; when detecting that at least one monitoring event is triggered, the marking processing of the target words triggered by the monitoring event includes:
and when the first monitoring event and the second monitoring event are both triggered, marking the target characters of the triggered monitoring event.
7. The method for processing the text information of the webpage according to any one of claims 1 to 6, wherein when the monitoring event corresponding to at least one word is detected to be triggered, marking the target word which is triggered to the monitoring event comprises:
when the monitoring event corresponding to at least one character is triggered, responding to a character processing instruction, and determining a target processing mode of the target character according to the character processing instruction;
and marking the target characters according to the target processing mode.
8. A text information processing apparatus for a web page, comprising:
the first acquisition unit is used for acquiring target text information of a webpage; each character in the target text information is provided with a monitoring event;
the first processing unit is used for marking the target character which is triggered to the monitoring event when the monitoring event corresponding to at least one character is triggered.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the text information processing method of a web page according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a method for processing text information of a web page according to any one of claims 1 to 7.
CN202110967302.6A 2021-08-23 2021-08-23 Webpage text information processing method and device and terminal equipment Pending CN113779438A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110967302.6A CN113779438A (en) 2021-08-23 2021-08-23 Webpage text information processing method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110967302.6A CN113779438A (en) 2021-08-23 2021-08-23 Webpage text information processing method and device and terminal equipment

Publications (1)

Publication Number Publication Date
CN113779438A true CN113779438A (en) 2021-12-10

Family

ID=78838759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110967302.6A Pending CN113779438A (en) 2021-08-23 2021-08-23 Webpage text information processing method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN113779438A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130227397A1 (en) * 2012-02-24 2013-08-29 Microsoft Corporation Forming an instrumented text source document for generating a live web page
CN103646078A (en) * 2013-12-11 2014-03-19 北京启明星辰信息安全技术有限公司 Method and device for realizing internet propaganda monitoring target evaluations
CN106294648A (en) * 2016-08-03 2017-01-04 腾讯科技(深圳)有限公司 A kind of processing method and processing device for page access path
CN108415804A (en) * 2018-01-23 2018-08-17 平安普惠企业管理有限公司 Obtain method, terminal device and the computer readable storage medium of information
CN109063079A (en) * 2018-07-25 2018-12-21 维沃移动通信有限公司 Webpage label method and electronic equipment
CN109960765A (en) * 2019-02-27 2019-07-02 深圳点猫科技有限公司 A kind of language based on programming carries out method, the electronic equipment of cross-domain communication to webpage
CN111159594A (en) * 2019-12-24 2020-05-15 深圳市优必选科技股份有限公司 Information processing method, information processing device and terminal equipment
CN112580300A (en) * 2020-12-30 2021-03-30 平安国际智慧城市科技股份有限公司 Text marking method and device, storage medium and computer equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130227397A1 (en) * 2012-02-24 2013-08-29 Microsoft Corporation Forming an instrumented text source document for generating a live web page
CN103646078A (en) * 2013-12-11 2014-03-19 北京启明星辰信息安全技术有限公司 Method and device for realizing internet propaganda monitoring target evaluations
CN106294648A (en) * 2016-08-03 2017-01-04 腾讯科技(深圳)有限公司 A kind of processing method and processing device for page access path
CN108415804A (en) * 2018-01-23 2018-08-17 平安普惠企业管理有限公司 Obtain method, terminal device and the computer readable storage medium of information
CN109063079A (en) * 2018-07-25 2018-12-21 维沃移动通信有限公司 Webpage label method and electronic equipment
CN109960765A (en) * 2019-02-27 2019-07-02 深圳点猫科技有限公司 A kind of language based on programming carries out method, the electronic equipment of cross-domain communication to webpage
CN111159594A (en) * 2019-12-24 2020-05-15 深圳市优必选科技股份有限公司 Information processing method, information processing device and terminal equipment
CN112580300A (en) * 2020-12-30 2021-03-30 平安国际智慧城市科技股份有限公司 Text marking method and device, storage medium and computer equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GARY WASSERMANN ET AL.: "Static detection of cross-site scripting vulnerabilities", 《PROCEEDINGS OF THE 30TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING》, pages 171 - 180 *
王丹: "基于DOM状态转换检测XSS漏洞", 《北京工业大学学报》, pages 1208 - 1216 *

Similar Documents

Publication Publication Date Title
US20220067268A1 (en) Systems and methods for remote dashboard image generation
CN108399072B (en) Application page updating method and device
Song et al. A hybrid approach for content extraction with text density and visual importance of DOM nodes
WO2014026510A1 (en) Webpage content browsing method, device and browser
CN104331474A (en) Page processing method and device
CN110851757A (en) Page resource loading method and terminal
CN112965645B (en) Page dragging method and device, computer equipment and storage medium
US20130073545A1 (en) Method and system for providing recommended content for user generated content on an article
CN111800492A (en) Method and device for marking characters in web page, computer equipment and storage medium
CN105868290A (en) Search result presentation method and apparatus
US20080282150A1 (en) Finding important elements in pages that have changed
WO2021189766A1 (en) Data visualization method and related device
US20150334159A1 (en) Method, System and Browser for Executing Active Object of Browser
US8719416B1 (en) Multiple subparts of a uniform resource locator
US20080168087A1 (en) System and Method for Managing Location-Independent Objects
CN111984262A (en) WeChat cascading style sheet file processing method, device, equipment and storage medium
CN113779438A (en) Webpage text information processing method and device and terminal equipment
CN109669799B (en) Error reporting control method, device and storage medium
CN114417226A (en) Page generation method, display method, device, electronic equipment and storage medium
CN112051952A (en) Picture dynamic browsing method and device, electronic equipment and readable storage medium
JP5523405B2 (en) Summary creating apparatus and method
CN112579937A (en) Character highlight display method and device
US9864739B1 (en) Automatic layout of graphical user interface screens from object data
CN112052368B (en) Method, system, storage medium and electronic device for automatically extracting list data
CN111190818B (en) Front-end code analysis method, front-end code analysis device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination