Packages

trait HtmlToJson extends Object

Html-to-Json - Parses HTML strings into objects using flexible, composable filters.

Annotations
@RawJSType() @native()
Version

0.6.0

See also

https://www.npmjs.com/package/html-to-json

Linear Supertypes
Object, Any, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HtmlToJson
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def batch[T <: Any](html: String, dictionary: Dictionary[_], callback: Function2[Error, T, Any] = js.native): Promise[T]

    Performs many parsing operations against one HTML string.

    Performs many parsing operations against one HTML string. This transforms the HTML into a DOM only once instead of for each filter in the dictionary, which can quickly get expensive in terms of processing. This also allows you to break your filters up into more granular components and mix and match them as you please.

    The values in the dictionary can be htmlToJson.Parser objects, generated methods from htmlToJson.createMethod, or naked filters that you might normally pass into htmlToJson.parse.

    html

    the HTML string

    dictionary

    a dictionary containing the elements to be processed

    callback

    the optional callback

    returns

    a promise

    Example:
    1. htmlToJson.batch(html, dictionary, [callback]) -> promise
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def createMethod[T](filter: Array[_], callback: Function2[Error, T, Any] = js.native): Any

    Generates a method that wraps the passed filter argument.

    Generates a method that wraps the passed filter argument. The generated method takes an HTML string and processes it against that filter.

    filter

    the given filter array

    Example:
    1. htmlToJson.createMethod(filter) -> function (html, [callback])
  8. def createParser[T <: Any](filter: Array[_]): Promise[T]

    For the sake of reusability, creates an object with .parse and .request helper methods, which use the passed filter.

    For the sake of reusability, creates an object with .parse and .request helper methods, which use the passed filter.

    filter

    the given filter array

    returns

    a promise

    Examples:
    1. new htmlToJson.Parser(filter)
    2. ,
    3. htmlToJson.createParser(filter)
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  13. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  20. def parse[T <: Any](html: String, filter: |[FilterOptions, RawOptions], callback: Function2[Error, T, Any] = js.native): Promise[T]

    The parse() method takes a string of HTML, and a filter, and responds with the filtered data.

    The parse() method takes a string of HTML, and a filter, and responds with the filtered data. This supports both callbacks and promises.

    Example:
    1. htmlToJson.parse(html, filter, [callback]) -> promise
  21. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  22. def request[T <: Any](request: |[String, RequestOptions], filter: |[FilterOptions, RawOptions], callback: Function2[Error, T, Any] = js.native): Promise[T]

    The request() method takes options for a call to the request library and a filter, then returns the filtered response body.

    The request() method takes options for a call to the request library and a filter, then returns the filtered response body.

    Example:
    1. htmlToJson.request(requestOptions, filter, [callback]) -> promise
  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. def toLocaleString(): String
    Definition Classes
    Object
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. def valueOf(): Any
    Definition Classes
    Object
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped