HTMLDocument

public class HTMLDocument: XMLDocument

HTML document which can be searched and queried.

  • HTML title of current document

    Declaration

    Swift

    public var title: String?
  • HTML head element of current document

    Declaration

    Swift

    public var head: XMLElement?
  • HTML body element of current document

    Declaration

    Swift

    public var body: XMLElement?
  • Creates and returns an instance of HTMLDocument from an HTML string, throwing XMLError if an error occured while parsing the HTML.

    Declaration

    Swift

    public convenience init(string: String, encoding: NSStringEncoding = NSUTF8StringEncoding) throws

    Parameters

    string

    The HTML string.

    encoding

    The string encoding.

    Return Value

    An HTMLDocument with the contents of the specified HTML string.

  • Creates and returns an instance of HTMLDocument from HTML data, throwing XMLError if an error occured while parsing the HTML.

    Declaration

    Swift

    public convenience init(data: NSData) throws

    Parameters

    data

    The HTML data.

    Return Value

    An HTMLDocument with the contents of the specified HTML string.

  • Creates and returns an instance of HTMLDocument from C char array, throwing XMLError if an error occured while parsing the HTML.

    Declaration

    Swift

    public convenience init(cChars: [CChar]) throws

    Parameters

    cChars

    cChars The HTML data as C char array

    Return Value

    An HTMLDocument with the contents of the specified HTML string.