CN106557587B - Method and system for storing and displaying webpage picture and corresponding text - Google Patents

Method and system for storing and displaying webpage picture and corresponding text Download PDF

Info

Publication number
CN106557587B
CN106557587B CN201611082606.XA CN201611082606A CN106557587B CN 106557587 B CN106557587 B CN 106557587B CN 201611082606 A CN201611082606 A CN 201611082606A CN 106557587 B CN106557587 B CN 106557587B
Authority
CN
China
Prior art keywords
text
offline
picture
displaying
file
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
CN201611082606.XA
Other languages
Chinese (zh)
Other versions
CN106557587A (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.)
Huizhou TCL Mobile Communication Co Ltd
Original Assignee
Huizhou TCL Mobile Communication 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 Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN201611082606.XA priority Critical patent/CN106557587B/en
Publication of CN106557587A publication Critical patent/CN106557587A/en
Application granted granted Critical
Publication of CN106557587B publication Critical patent/CN106557587B/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/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to the technical field of Internet, and discloses a method and a system for storing and displaying a webpage picture and a corresponding text, wherein the method comprises the following steps: storing the currently displayed webpage as an offline picture, and recording text elements, display positions and sizes visible in the current webpage as offline text nodes; storing the offline picture and the offline text node as an offline file, and displaying the offline picture and loading the offline text node to the offline picture after receiving an instruction for opening the offline file; and when an instruction of clicking a corresponding position on the offline picture to select an offline text node is received, executing a text viewing instruction to obtain text content and displaying the text content in a text box. The invention ensures the correct display of the off-line web page content by simultaneously storing the web page pictures and the corresponding texts, and can copy the corresponding texts, thereby being convenient for users.

Description

Method and system for storing and displaying webpage picture and corresponding text
Technical Field
The invention relates to the technical field of internet, in particular to a method and a system for storing and displaying a webpage picture and a corresponding text.
Background
Today, the internet is developed, people almost browse web pages every day, and know various information through the web pages, sometimes, after a certain or some web pages are opened, the information of the web pages is important or interesting for people, and people need to wait for the time to see the web pages carefully, at this time, the web pages need to be saved, and then the content of the web pages is restored by reloading the web pages.
Many users have habit and requirement of saving offline web pages and browsing them again, so the browser provides function of saving offline web pages and makes offline conversion processing on web pages, but such offline processing is often incomplete, especially when there is script (script: executable file written according to a certain format using a specific descriptive language, also called macro or batch file) in web pages, many scripts are not operated correctly when offline, so many offline web pages are displayed incorrectly.
In addition, some browsers provide a function of saving a web page as a picture, and the content of the web page saved in the picture mode is displayed normally, but text cannot be copied on the picture.
Therefore, the prior art still needs to be improved and developed to address the above drawbacks.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method and a system for storing and displaying a web page picture and a corresponding text, aiming at ensuring correct display of offline web page contents and copying the corresponding text at the same time by storing the web page picture and the corresponding text at the same time, thereby facilitating users.
The technical scheme adopted by the invention for solving the technical problem is as follows:
a method for saving and displaying webpage pictures and corresponding texts comprises the following steps:
step A, storing a currently displayed webpage as an offline picture, and recording a text element, a display position and a size which are visible in the current webpage as an offline text node;
step B, storing the offline picture and the offline text node as an offline file, and displaying the offline picture and loading the offline text node to the offline picture after receiving an instruction of opening the offline file;
and step C, when an instruction of clicking a corresponding position on the offline picture to select an offline text node is received, executing a text viewing instruction to obtain text content and displaying the text content in a text box.
The method for saving and displaying the webpage pictures and the corresponding texts comprises the following steps after the step C:
and D, after receiving an operation instruction of copying the text by the user, displaying an icon of the copied text in the text box, and selecting the corresponding text in the copied text box.
The method for storing and displaying the webpage pictures and the corresponding texts comprises the following specific steps:
a1, saving the currently displayed webpage as an offline picture;
and A2, traversing the DOM tree of the current webpage, recording the text elements visible to the current webpage, and recording the text elements, the display position and the size as offline text nodes.
The method for storing and displaying the webpage pictures and the corresponding texts comprises the following steps:
b1, storing the offline picture and the offline text node as an offline file;
b2, when receiving the command of opening the offline file, opening the offline file;
and B3, displaying the offline picture, and correspondingly loading the offline text node to the offline picture according to the display position.
The method for storing and displaying the webpage pictures and the corresponding texts comprises the following specific steps:
c1, receiving an instruction of selecting an offline text node by clicking a corresponding position on the offline picture, and executing a text viewing instruction;
c2, after the text is viewed, obtaining the text contents of all the selected offline text nodes, and combining the text contents according to the display positions of the nodes;
and C3, displaying the text content obtained by combination in the text box.
A system for saving and displaying web page pictures and corresponding text, comprising:
the webpage storage module is used for storing the currently displayed webpage as an offline picture and recording text elements, display positions and sizes visible in the current webpage as offline text nodes;
the file display module is used for storing the offline picture and the offline text node as an offline file, and displaying the offline picture and loading the offline text node to the offline picture after receiving an instruction of opening the offline file;
and the content display module is used for executing the text viewing instruction to obtain text content and displaying the text content in the text box when receiving an instruction of selecting an offline text node by clicking a corresponding position on the offline picture.
The system for saving and displaying the webpage pictures and the corresponding texts comprises:
and the text copying module is used for displaying an icon of the copied text in the text box and selecting the corresponding text in the copied text box after receiving an operation instruction of copying the text by the user.
The system for saving and displaying the webpage pictures and the corresponding texts comprises a webpage saving module, wherein the webpage saving module specifically comprises:
the first storage unit is used for storing the currently displayed webpage as an offline picture;
and the recording unit is used for traversing the DOM tree of the current webpage, recording the visible text elements of the current webpage, and recording the text elements, the display position and the size as offline text nodes.
The system for saving and displaying the webpage pictures and the corresponding texts comprises a file display module, wherein the file display module specifically comprises:
the second storage unit is used for storing the offline picture and the offline text node as an offline file;
the file opening unit is used for opening the offline file after receiving an instruction of opening the offline file;
and the display loading unit is used for displaying the offline picture and correspondingly loading the offline text node to the offline picture according to the display position.
The system for storing and displaying the webpage pictures and the corresponding texts comprises a content display module, wherein the content display module specifically comprises:
the text viewing unit is used for receiving an instruction of selecting an offline text node by clicking a corresponding position on the offline picture and executing a text viewing instruction;
the content merging unit is used for obtaining the text contents of all the selected offline text nodes after the text is viewed, and merging the text contents according to the display positions of the nodes;
and the display unit is used for displaying the text content obtained by combination in the text box.
The invention discloses a method and a system for saving and displaying a webpage picture and a corresponding text, wherein the method comprises the following steps: storing the currently displayed webpage as an offline picture, and recording text elements, display positions and sizes visible in the current webpage as offline text nodes; storing the offline picture and the offline text node as an offline file, and displaying the offline picture and loading the offline text node to the offline picture after receiving an instruction for opening the offline file; and when an instruction of clicking a corresponding position on the offline picture to select an offline text node is received, executing a text viewing instruction to obtain text content and displaying the text content in a text box. The invention ensures the correct display of the off-line web page content by simultaneously storing the web page pictures and the corresponding texts, and can copy the corresponding texts, thereby being convenient for users.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of a method for saving and displaying web page pictures and corresponding text according to the present invention.
FIG. 2 is a functional block diagram of a preferred embodiment of the system for saving and displaying web page pictures and corresponding text in accordance with the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for saving and displaying a web page picture and a corresponding text according to a preferred embodiment of the present invention.
As shown in fig. 1, a method for saving and displaying a web page picture and a corresponding text provided by an embodiment of the present invention includes the following steps:
step S100, storing the currently displayed webpage as an offline picture, and recording the text elements, the display positions and the sizes visible in the current webpage as offline text nodes.
Further, the step S100 specifically includes:
s110, saving the currently displayed webpage as an offline picture;
s120, traversing the DOM tree of the current webpage, recording the visible text elements of the current webpage, and recording the text elements, the display position and the size as offline text nodes.
In the present invention, a web page is a basic element constituting a web site, which is a platform for bearing various web site applications, and in a popular way, a web site is composed of web pages, and if only a domain name and a virtual host are available, a user still cannot access the web site.
Firstly, saving a currently displayed webpage as an offline picture, traversing a DOM tree of the current webpage, then recording a text element visible in the current webpage, and recording the text element, the display position and the size as an offline text node.
DOM (document Object model) is a document Object model, a standard programming interface for handling extensible markup language, in which the objects that organize pages (or documents) are organized in a tree structure, and the standard model used to represent the objects in a document is called DOM, which can access and modify the content and structure of a document in a platform and language independent manner, in other words, it is a common method for representing and handling an HTM L or XM L document, and can modify HTM L elements or obtain element information through DOM.
Traversal (Traversal) refers to making one and only one access to each node in the tree in sequence along a search route. The operation of the access node depends on specific application problems, and traversal is one of the most important operations in the binary tree and is the basis for performing other operations in the binary tree.
And step S200, storing the offline picture and the offline text node as an offline file, and displaying the offline picture and loading the offline text node to the offline picture after receiving an instruction of opening the offline file.
Further, the step S200 specifically includes:
s210, storing the offline picture and the offline text node as an offline file;
s220, after receiving an instruction of opening the offline file, opening the offline file;
and S230, displaying the offline picture, and correspondingly loading the offline text node to the offline picture according to the display position.
In the invention, the off-line picture and the off-line text node which are stored before are stored as an off-line file (the off-line file refers to that when the file is transmitted to a user of the opposite side, the on-line file is stored in an intermediate network for a certain time, and when the opposite side is on line, the on-line file is actively transmitted to the opposite side), when an instruction that the user needs to open the off-line file is received, the off-line file is opened, the off-line picture is further displayed, and the off-line text node is correspondingly loaded on the off-line picture according to the display.
Step S300, when an instruction of clicking a corresponding position on the offline picture to select an offline text node is received, executing a text viewing instruction to obtain text content and displaying the text content in a text box.
Further, the step S300 specifically includes:
s310, receiving an instruction of clicking a corresponding position on an offline picture to select an offline text node, and executing a text checking instruction;
s320, after the text is viewed, obtaining the text contents of all the selected offline text nodes, and combining the text contents according to the display positions of the nodes;
and S330, displaying the text content obtained by combination in a text box.
In the present invention, after the step S300, the method further includes a step S400: after receiving an operation instruction of copying the text by the user, displaying an icon of the copied text in the text box, and selecting the corresponding text in the copied text box, namely, the user can copy the required text content, thereby solving the problem that the text cannot be copied on the picture.
Based on the above embodiments, the present invention further provides a system for saving and displaying a web page picture and a corresponding text, please refer to fig. 2, and fig. 2 is a functional schematic block diagram of a preferred embodiment of the system for saving and displaying a web page picture and a corresponding text according to the present invention.
As shown in fig. 2, the system includes:
the web page saving module 210 is configured to save a currently displayed web page as an offline picture, and record a text element, a display position, and a size visible in the current web page as an offline text node; as described above.
The file display module 220 is configured to store the offline picture and the offline text node as an offline file, and when an instruction to open the offline file is received, display the offline picture and load the offline text node onto the offline picture; as described above.
The content display module 230 is configured to, when receiving an instruction for selecting an offline text node by clicking a corresponding position on the offline icon, execute a text viewing instruction to obtain text content and display the text content in a text box; as described above.
The text copying module 240 is configured to display an icon of the copied text in the text box and select a corresponding text in the copied text box after receiving an operation instruction of copying the text by the user; as described above.
Further, the system for saving and displaying the web page pictures and the corresponding texts comprises a web page saving module, wherein the web page saving module specifically comprises:
the first storage unit is used for storing the currently displayed webpage as an offline picture; as described above.
The recording unit is used for traversing the DOM tree of the current webpage, recording the visible text elements of the current webpage, and recording the text elements, the display position and the size as offline text nodes; as described above.
Further, the system for saving and displaying the web page pictures and the corresponding texts comprises:
the second storage unit is used for storing the offline picture and the offline text node as an offline file; as described above.
The file opening unit is used for opening the offline file after receiving an instruction of opening the offline file; as described above.
The display loading unit is used for displaying the offline picture and correspondingly loading the offline text nodes to the offline picture according to the display position; as described above.
Further, the system for saving and displaying the web page pictures and the corresponding texts comprises a content display module, wherein the content display module specifically comprises:
the text viewing unit is used for receiving an instruction of selecting an offline text node by clicking a corresponding position on the offline picture and executing a text viewing instruction; as described above.
The content merging unit is used for obtaining the text contents of all the selected offline text nodes after the text is viewed, and merging the text contents according to the display positions of the nodes; as described above.
The display unit is used for displaying the text content obtained by combination in a text box; as described above.
In summary, the present invention discloses a method and a system for saving and displaying a web page picture and a corresponding text, wherein the method comprises: storing the currently displayed webpage as an offline picture, and recording text elements, display positions and sizes visible in the current webpage as offline text nodes; storing the offline picture and the offline text node as an offline file, and displaying the offline picture and loading the offline text node to the offline picture after receiving an instruction for opening the offline file; and when an instruction of clicking a corresponding position on the offline picture to select an offline text node is received, executing a text viewing instruction to obtain text content and displaying the text content in a text box. The invention ensures the correct display of the off-line web page content by simultaneously storing the web page pictures and the corresponding texts, and can copy the corresponding texts, thereby being convenient for users.
Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program instructing relevant hardware (such as a processor, a controller, etc.), and the program may be stored in a computer readable storage medium, and when executed, the program may include the processes of the above method embodiments. The storage medium may be a memory, a magnetic disk, an optical disk, etc.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (8)

1. A method for saving and displaying web page pictures and corresponding texts is characterized by comprising the following steps:
step A, storing a currently displayed webpage as an offline picture, and recording a text element, a display position and a size which are visible in the current webpage as an offline text node;
step B, storing the offline picture and the offline text node as an offline file, and displaying the offline picture and loading the offline text node to the offline picture after receiving an instruction of opening the offline file;
step C, when an instruction of clicking a corresponding position on the offline picture to select an offline text node is received, executing a text viewing instruction to obtain text content and displaying the text content in a text box;
the step C specifically comprises the following steps:
c1, receiving an instruction of selecting an offline text node by clicking a corresponding position on the offline picture, and executing a text viewing instruction;
c2, after the text is viewed, obtaining the text contents of all the selected offline text nodes, and combining the text contents according to the display positions of the nodes;
and C3, displaying the text content obtained by combination in the text box.
2. The method for saving and displaying pictures and corresponding texts of web pages according to claim 1, wherein said step C is followed by further comprising:
and D, after receiving an operation instruction of copying the text by the user, displaying an icon of the copied text in the text box, and selecting the corresponding text in the copied text box.
3. The method for saving and displaying web page pictures and corresponding texts according to claim 1, wherein the step a specifically comprises:
a1, saving the currently displayed webpage as an offline picture;
and A2, traversing the DOM tree of the current webpage, recording the text elements visible to the current webpage, and recording the text elements, the display position and the size as offline text nodes.
4. The method for saving and displaying web page pictures and corresponding texts according to claim 3, wherein the step B specifically comprises:
b1, storing the offline picture and the offline text node as an offline file;
b2, when receiving the command of opening the offline file, opening the offline file;
and B3, displaying the offline picture, and correspondingly loading the offline text node to the offline picture according to the display position.
5. A system for storing and displaying web page pictures and corresponding text, comprising:
the webpage storage module is used for storing the currently displayed webpage as an offline picture and recording text elements, display positions and sizes visible in the current webpage as offline text nodes;
the file display module is used for storing the offline picture and the offline text node as an offline file, and displaying the offline picture and loading the offline text node to the offline picture after receiving an instruction of opening the offline file;
the content display module is used for executing a text viewing instruction to obtain text content and displaying the text content in a text box when receiving an instruction of selecting an offline text node by clicking a corresponding position on the offline picture;
the content display module specifically comprises:
the text viewing unit is used for receiving an instruction of selecting an offline text node by clicking a corresponding position on the offline picture and executing a text viewing instruction;
the content merging unit is used for obtaining the text contents of all the selected offline text nodes after the text is viewed, and merging the text contents according to the display positions of the nodes;
and the display unit is used for displaying the text content obtained by combination in the text box.
6. The system for saving and displaying pictures and corresponding text on a web page according to claim 5, further comprising:
and the text copying module is used for displaying an icon of the copied text in the text box and selecting the corresponding text in the copied text box after receiving an operation instruction of copying the text by the user.
7. The system for saving and displaying web page pictures and corresponding texts according to claim 5, wherein the web page saving module specifically comprises:
the first storage unit is used for storing the currently displayed webpage as an offline picture;
and the recording unit is used for traversing the DOM tree of the current webpage, recording the visible text elements of the current webpage, and recording the text elements, the display position and the size as offline text nodes.
8. The system for saving and displaying web page pictures and corresponding texts according to claim 7, wherein the file display module specifically comprises:
the second storage unit is used for storing the offline picture and the offline text node as an offline file;
the file opening unit is used for opening the offline file after receiving an instruction of opening the offline file;
and the display loading unit is used for displaying the offline picture and correspondingly loading the offline text node to the offline picture according to the display position.
CN201611082606.XA 2016-11-30 2016-11-30 Method and system for storing and displaying webpage picture and corresponding text Active CN106557587B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611082606.XA CN106557587B (en) 2016-11-30 2016-11-30 Method and system for storing and displaying webpage picture and corresponding text

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611082606.XA CN106557587B (en) 2016-11-30 2016-11-30 Method and system for storing and displaying webpage picture and corresponding text

Publications (2)

Publication Number Publication Date
CN106557587A CN106557587A (en) 2017-04-05
CN106557587B true CN106557587B (en) 2020-07-14

Family

ID=58446049

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611082606.XA Active CN106557587B (en) 2016-11-30 2016-11-30 Method and system for storing and displaying webpage picture and corresponding text

Country Status (1)

Country Link
CN (1) CN106557587B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108021611B (en) * 2017-11-02 2021-11-23 广州中山大学出版社有限公司 Method and device for selecting text information in picture

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100565524C (en) * 2007-03-27 2009-12-02 腾讯科技(深圳)有限公司 A kind of system, method and browser of preserving web page contents
US20110087953A1 (en) * 2009-10-08 2011-04-14 Grohs Anton C Automated embeddable searchable static rendering of a webpage generator
CN103870191B (en) * 2012-12-18 2017-12-26 腾讯科技(深圳)有限公司 The method and electronic equipment that webpage preserves
CN103731467A (en) * 2013-09-26 2014-04-16 西安酷派软件科技有限公司 Webpage information sharing method and communication terminal
CN106126655A (en) * 2016-06-27 2016-11-16 乐视控股(北京)有限公司 Webpage preservation treatment method and device

Also Published As

Publication number Publication date
CN106557587A (en) 2017-04-05

Similar Documents

Publication Publication Date Title
US10346522B2 (en) Optimization for rendering web pages
US10372810B2 (en) Smarter copy/paste
US9582601B2 (en) Combining server-side and client-side user interface elements
US8386955B1 (en) User-optimized content for web browsing windows
RU2589335C2 (en) Dragging of insert
US10909304B2 (en) Methods and systems for WYSIWYG web content generation
JP5075920B2 (en) Web data usage platform
US8296673B2 (en) Collapsible tabbed user interface
CN102662944B (en) By the direct navigation of browser address bar
US10282399B2 (en) System and method for web content presentation management
CN109408752B (en) Online document display method and device and electronic equipment
US9069432B2 (en) Copy and paste buffer
US9792383B2 (en) Unload and display content placeholders with versions
CN103761218A (en) Method for annotating and commenting electronic document on computer
CN111539188A (en) Note generation method, computing device and computer storage medium
CN108459998B (en) Document updating method, document updating device, document format converting method, document updating format converting device, document format converting device and readable storage medium
KR20150095663A (en) Flat book to rich book conversion in e-readers
US8091016B2 (en) Visually manipulating instance collections
CN106557587B (en) Method and system for storing and displaying webpage picture and corresponding text
US20120047429A1 (en) Methods for further adapting XSL to HTML document transformations and devices thereof
CN105739717B (en) Data inputting method and device
CN112130908A (en) Method and device for setting user guide
US11120099B2 (en) Rendering a web element in a web page
WO2016111882A1 (en) Control of access and management of browser annotations
CN113485714B (en) Data processing method, 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
GR01 Patent grant
GR01 Patent grant