Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - Português - Русский

Please note that the recommended version of Scilab is 6.1.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> XML Management > htmlRead


Read a HTML stream from a local or distant file

Calling Sequence

doc = htmlRead(path [, encoding])



a string, the path to the file to read.


a string, the file encoding.


a mlist typed XMLDoc


Read and parse a HTML file. The returned document allows to access to the DOM tree which is kept in memory.

In general, a HTML file cannot be read with a XML parser because a HTML is rarely well-formated, so a HTML parser is required and it is more compliant.

Once the HTML file is parsed, it can be seen as a XML file in memory, so usual operations can be done.

The encoding argument is used to precise the file encoding.

It is important to notice that the tree must be freed (to avoid memory leaks) with the function xmlDelete.


doc = htmlRead("");
e = doc.root.children(1).children(1)

// Now we can retrieve all the nodes with an 'href' attribute
q = xmlXPath(doc, "//*[@href]");

// We delete the doc

See Also

  • htmlReadStr — Read a HTML tree from a string
  • xmlGetOpenDocs — オープンされたXML文書またはXML検証ファイルを全て取得する.
  • xmlDelete — XML文書を削除
  • xmlDocument — XML文書を新規に作成
  • xmlXPath — XML文書にXPathクエリを作成する


5.5.0 HTML features added.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Fri Apr 11 14:18:58 CEST 2014