OpenersPrimaryExamplesSection(Spacer1)Examples  (8)

OpenersExampleSection0(Spacer1)Basic Examples  (8)

Import all images from a web page:

Import["http://www.wolfram.com/language/","Images"]

Read an HTML file as plain text:

Import["ExampleData/worldpopulation.html"]

Show the (RefLink[Import, paclet:ref/Import]) elements available in this file:

Import["ExampleData/worldpopulation.html","Elements"]

Import the tabular content from this file:

Import["ExampleData/worldpopulation.html", "Data"] // TableForm

This exports a mathematical expression to HTML:

Export["formula.html",Sqrt[a - b/4]]

Show the names of the files saved into the "HTMLFiles" directory:

Import["HTMLFiles", "Directory"]

Import the rasterized typeset expression:

Import["HTMLFiles/formula_1.gif"]

This translates a (RefLink[Cell, paclet:ref/Cell]) expression to HTML:

ExportString[Cell[TextData["Converting a Cell expression to HTML"],"Subsection"], "HTML"]

The Wolfram Language can export graphics with embedded tooltips and hyperlinks to HTML image maps:

Graphics[{Tooltip[Hyperlink[{Purple,Rectangle[{0,0}]},"http://www.wolfram.com"],"Wolfram Research"],Tooltip[Hyperlink[{Orange,Rectangle[{1.2,0}]},"http://www.wolfram.com/products/mathematica"],"Mathematica"]},ImageSize->{150,75}]

Export["imagemap.html",%]

The mapping of Wolfram System style elements to HTML can be specified as "ConversionRules":

ExportString[Cell[TextData["Using ConversionRules"],"Subsection"],"HTML","ConversionRules"->{"Subsection"->{"<b><i>","</i></b>"}}]

Export a formatted table to HTML:

ExportString[Notebook[{Cell[BoxData[GridBox[{{"a","b"},{"c","d"}}]],"Input"]}],"HTML"]

Create an HTML fragment:

ExportString[Cell[TextData["Some text"],"Text"], "HTML", "FullDocument" -> False]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {Related Formats:  (RefLink[HTMLFragment, paclet:ref/format/HTMLFragment])  ▪  (RefLink[EPS, paclet:ref/format/EPS])  ▪  (RefLink[GIF, paclet:ref/format/GIF])  ▪  (RefLink[LaTeX, paclet:ref/format/LaTeX])  ▪  (RefLink[MathML, paclet:ref/format/MathML])  ▪  (RefLink[NB, paclet:ref/format/NB])  ▪  (RefLink[PDF, paclet:ref/format/PDF])  ▪  (RefLink[RTF, paclet:ref/format/RTF])  ▪  (RefLink[SVG, paclet:ref/format/SVG])  ▪  (RefLink[SWF, paclet:ref/format/SWF])  ▪  (RefLink[TeX, paclet:ref/format/TeX])  ▪  (RefLink[XHTML, paclet:ref/format/XHTML])  ▪  (RefLink[XHTMLMathML, paclet:ref/format/XHTMLMathML])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Wolfram System Internet Connectivity, paclet:tutorial/InternetConnectivity])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Creating Web Pages, paclet:guide/CreatingWebPages])}, {▪(RefLinkPlain[Document Formats, paclet:guide/DocumentFormats])}, {▪(RefLinkPlain[Graphics Importing & Exporting, paclet:guide/GraphicsImportingAndExporting])}, {▪(RefLinkPlain[Importing & Exporting, paclet:guide/ImportingAndExporting])}, {▪(RefLinkPlain[Importing & Exporting in Notebooks, paclet:guide/ImportingAndExportingInNotebooks])}, {▪(RefLinkPlain[Listing of All Formats, paclet:guide/ListingOfAllFormats])}, {▪(RefLinkPlain[New in 6.0: Notebooks & Documents, paclet:guide/NewIn60NotebooksAndDocuments])}, {▪(RefLinkPlain[Numerical Data, paclet:guide/NumericalData])}, {▪(RefLinkPlain[Processing Textual Data, paclet:guide/ProcessingTextualData])}, {▪(RefLinkPlain[Web Formats, paclet:guide/WebFormats])}, {▪(RefLinkPlain[Web Operations, paclet:guide/WebOperations])}})}})