1. Technical Field
The present disclosure relates to HTML document devices and, particularly, to a system and method for updating HTML documents in an HTML document updating device.
2. Description of Related Art
Some special system programs such as spider programs are embedded in some webpages and can obtain content of other webpages, thus users can get information from other webpages with similar content. However, the usual special system cannot timely update the obtained content of the other webpages, thus users may not get the latest information from the other webpages.
The components of the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the present disclosure. Moreover, in the drawings, like reference numerals designate corresponding parts throughout several views.
Embodiments of the present disclosure are now described in detail, with reference to the accompanying drawings.
In general, the word “module,” as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, for example, Java, C, or Assembly. One or more software instructions in the modules may be embedded in firmware, such as an EPROM. It will be appreciated that modules may comprised connected logic units, such as gates and flip-flops, and may comprise programmable units, such as programmable gate arrays or processors. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of computer-readable medium or other computer storage system.
Referring to
The input module 101 provides a user interface for a user to input information. In this embodiment, a given website address is input and saved as a URL (Uniform/Universal Resource Locator, URL) of the webpage in response to user inputs.
The obtaining module 102 obtains an HTML document of the given webpage according to the given website address of the URL every a time interval. In detail, the obtaining module 102 employs the web Browser to retrieve the HTML document of the given webpage. Once the HTML document has been retrieved, the web Browser will display the webpage to the user. In the embodiment, the time interval is a default value or set by the user through the user interface provided by the input module 101.
The document processing module 103 determines whether there is a saved HTML document of the given webpage when the obtaining module 102 is to obtain the HTML document of the webpage. If there is no saved HTML document, the document processing module 103 saves the currently obtained HTML document of the given webpage (hereinafter, currently obtained HTML document).
If there is a saved HTML document of the given webpage, the document processing module 103 analyzes the saved HTML document of the given webpage (hereinafter, saved HTML document) and the current obtained HTML document to obtain the HTML elements of the saved HTML document and the currently obtained HTML document. The document processing module 103 compares each HTML element of the saved document with the corresponding HTML element of the currently obtained HTML document. If there is no match, the document processing module 103 updates the HTML element of the saved HTML document with the corresponding HTML element of the currently obtained HTML document. If there is a match, the document processing module 103 does not update the saved HTML document. In the embodiment, the HTML elements may include button ActiveXs, or table ActiveXs. The document processing module 103 analyzes the HTML documents and obtains the HTML elements through document.getElementById, which is a function of JavaScript language and the description of which is omitted herein.
Referring to
In step S201, the input module 101 provides a user interface for a user to input a given website address, and save the input given website address as a URL of the webpage in response to the user inputs.
In step S202, the obtaining module 102 obtains the HTML document of the given webpage according to the input given website address of the URL every a time interval.
In step S203, the document processing module 103 determines whether there is a saved HTML document of the given webpage. If there is a saved HTML document of the given webpage, the procedure goes to S204. If there is no saved HTML document of the given webpage, the procedure goes to S206.
In step S204, the document processing module 103 analyzes the currently obtained HTML document and the saved HTML document to obtain the HTML elements of the current HTML document and the HTML elements of the saved HTML document.
In step S205, the document processing module 103 updates the HTML element of the saved HTML document with the corresponding HTML element of the currently obtained HTML document and saves the updated HTML element when the HTML element of the saved document does not match the corresponding HTML element of the currently obtained HTML document.
In step S206, the document processing module 103 saves the currently obtained HTML document.
Although the present disclosure has been specifically described on the basis of the exemplary embodiment thereof, the disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the embodiment without departing from the scope and spirit of the disclosure.
| Number | Date | Country | Kind |
|---|---|---|---|
| 201110023799.2 | Jan 2011 | CN | national |