System and method for converting and importing web site content
View Patent ↗A system and method for converting and importing web site content are presented. A web page is rendered to create a rendered web page. The web page may be rendered by at least one server communicatively coupled to a network. The rendered web page is inspected to identify a plurality of display elements. Display attributes are captured for each one of the plurality of display elements in the rendered web page, and mark-up code is generated using the display attributes for each one of the plurality of display elements.
1. A method, comprising:
rendering, by at least one server communicatively coupled to a network, a web page to create a rendered web page;
storing, by the at least one server, a screenshot depicting the rendered web page;
modifying the rendered web page to tokenize a plurality of words in the rendered web page by converting each word in the plurality of words into a separate display element in a document object model of the rendered web page;
inspecting, by the at least one server, the document object model to identify a plurality of display elements by:
determining a z-index position of a first display element in the plurality of display elements,
determining a z-index position of a second display element in the plurality of display elements, wherein the second display element overlaps the first display element in the rendered web page,
determining that the z-index position of the first display element is greater than the z-index position of the second display element, and
including the first display element in the plurality of display elements;
identifying a grouping node for the plurality of display elements in the document object model by:
identifying, for a first display element in the document object model, an ancestor node in the document object model;
determining that the ancestor node in the document object model contains a number of child nodes, wherein each child node contains only text elements;
when the ancestor node contains a number of child nodes and each child node contains only text elements, determining that the ancestor node is a grouping node for the plurality of display elements;
capturing, by the at least one server, display attributes for each one of the plurality of display elements;
generating, by the at least one server, mark-up code using the display attributes for each one of the plurality of display elements and the grouping node in the document object model by:
determining a most common text style in the plurality of display elements in the document object model,
associating the most common text style with a paragraph tag in a style sheet,
determining a second text style in the plurality of display elements including a font size larger than a font size of the most common text style,
associating the second text style with an HI tag in the style sheet,
determining a third text style in the plurality of display elements including a font size smaller than the font size of the most common text style, and
associating the third text style with a span tag having a first class in the style sheet;
generating, by the at least one server, a second rendered web page using the mark-up code and the style sheet; and
generating, by the at least one server, a user interface depicting simultaneously the second rendered web page and the screenshot depicting the rendered web page.
2. The method of claim 1 , wherein converting each word in the plurality of words into a separate display element in the document object model includes inserting a span tag around each word in the plurality of words in the document object model.
3. The method of claim 1 , including grouping one or more of the plurality of words into columns.
4. The method of claim 3 , including identifying one or more lines of words in each one of the columns.
5. The method of claim 1 , wherein the plurality of display elements include words, images, or shapes.
6. The method of claim 1 , wherein the display attributes include a position, a font size, or a border attribute.
7. The method of claim 1 , including identifying a user associated with the web page.
8. A method, comprising:
identifying, by at least one server communicatively coupled to a network, a plurality of web pages, the plurality of web pages being associated with a web site;
for each one of the plurality of web pages:
rendering, by the at least one server, the one of the plurality of web pages to create a rendered web page;
storing, by the at least one server, a screenshot depicting the rendered web page;
modifying the rendered web page to tokenize a plurality of words in the rendered web page by converting each word in the plurality of words into a separate display element in a document object model of the rendered web page;
inspecting, by the at least one server, the document object model to identify a plurality of display elements by:
determining a z-index position of a first display element in the plurality of display elements,
determining a z-index position of a second display element in the plurality of display elements, wherein the second display element overlaps the first display element in the rendered web page,
determining that the z-index position of the first display element is greater than the z-index position of the second display element, and
including the first display element in the plurality of display elements;
identifying a grouping node for the plurality of display elements in the document object model by:
identifying, for a first display element in the document object model, an ancestor node in the document object model;
determining that the ancestor node in the document object model contains a number of child nodes, wherein each child node contains only text elements;
when the ancestor node contains a number of child nodes and each child node contains only text elements, determining that the ancestor node is a grouping node for the plurality of display elements;
capturing, by the at least one server, display attributes for each one of the plurality of display elements;
generating, by the at least one server, mark-up code using the display attributes for each one of the plurality of display elements and the grouping node in the document object model by:
determining a most common text style in the plurality of display elements in the document object model,
associating the most common text style with a paragraph tag in a style sheet,
determining a second text style in the plurality of display elements including a font size larger than a font size of the most common text style,
associating the second text style with an HI tag in the style sheet,
determining a third text style in the plurality of display elements including a font size smaller than the font size of the most common text style, and
associating the third text style with a span tag having a first class in the style sheet;
generating, by the at least one server, a second rendered web page using the mark-up code and the style sheet; and
generating, by the at least one server, a user interface depicting simultaneously the second rendered web page and the screenshot depicting the rendered web page.
9. The method of claim 8 , wherein converting each word in the plurality of words into a separate display element in the document object model includes inserting a span tag around each word in the plurality of words in the document object model.
10. The method of claim 8 , including grouping one or more of the plurality of words into columns.
11. The method of claim 10 , including identifying one or more lines of words in each one of the columns.
12. A system, comprising:
a processor configured to:
identify a plurality of web pages, the plurality of web pages being associated with a web site;
for each one of the plurality of web pages:
render the one of the plurality of web pages to create a rendered web page;
store a screenshot depicting the rendered web page;
modify the rendered web page to tokenize a plurality of words in the rendered web page by converting each word in the plurality of words into a separate display element in a document object model of the rendered web page;
inspect the rendered web page to identify a plurality of display elements by:
determining a z-index position of a first display element in the plurality of display elements,
determining a z-index position of a second display element in the plurality of display elements, wherein the second display element overlaps the first display element in the rendered web page,
determining that the z-index position of the first display element is greater than the z-index position of the second display element, and
including the first display element in the plurality of display elements;
identify a grouping node for the plurality of display elements in the document object model by:
identifying, for a first display element in the document object model, an ancestor node in the document object model;
determining that the ancestor node in the document object model contains a number of child nodes, wherein each child node contains only text elements;
when the ancestor node contains a number of child nodes and each child node contains only text elements, determining that the ancestor node is a grouping node for the plurality of display elements;
capture display attributes for each one of the plurality of display elements;
generate mark-up code using the display attributes for each one of the plurality of display elements and the grouping node in the document object model by:
determining a most common text style in the plurality of display elements in the document object model,
associating the most common text style with a paragraph tag in a style sheet,
determining a second text style in the plurality of display elements including a font size larger than a font size of the most common text style,
associating the second text style with an HI tag in the style sheet,
determining a third text style in the plurality of display elements including a font size smaller than the font size of the most common text style, and
associating the third text style with a span tag having a first class in the style sheet;
generate a second rendered web page using the mark-up code and the style sheet; and
generate a user interface depicting simultaneously the second rendered web page and the screenshot depicting the rendered web page.
13. The system of claim 12 , wherein the processor is configured to insert a span tag around each word in the plurality of words in the document object model.
14. The system of claim 13 , wherein the processor is configured to group one or more of the plurality of words into columns.
15. The system of claim 14 , wherein the processor is configured to identify one or more lines of words in each one of the columns.