Packages

class JsoupBrowser extends Browser

A Browser implementation based on jsoup, a Java HTML parser library. JsoupBrowser provides powerful and efficient document querying, but it doesn't run JavaScript in the pages. As such, it is limited to working strictly with the HTML send in the page source.

Currently, JsoupBrowser does not keep separate cookie stores for different domains and paths. In each request all cookies set previously will be sent, regardless of the domain they were set on. If you do requests to different domains and do not want this behavior, use different JsoupBrowser instances.

As the documents parsed by JsoupBrowser instances are not changed after loading, Document and Element instances obtained from them are guaranteed to be immutable.

Linear Supertypes
Browser, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsoupBrowser
  2. Browser
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new JsoupBrowser(userAgent: String = "jsoup/1.8", proxy: java.net.Proxy = null)

    userAgent

    the user agent with which requests should be made

    proxy

    an optional proxy configuration to use

Type Members

  1. type DocumentType = JsoupDocument

    The concrete type of documents created by this browser.

    The concrete type of documents created by this browser.

    Definition Classes
    JsoupBrowserBrowser

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 clearCookies(): Unit

    Clears the cookie store of this browser.

    Clears the cookie store of this browser.

    Definition Classes
    JsoupBrowserBrowser
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  7. def cookies(url: String): Map[String, String]

    Returns the current set of cookies stored in this browser for a given URL.

    Returns the current set of cookies stored in this browser for a given URL.

    url

    the URL whose stored cookies are to be returned

    returns

    a mapping of cookie names to their respective values.

    Definition Classes
    JsoupBrowserBrowser
  8. def defaultRequestSettings(conn: Connection): Connection
    Attributes
    protected[this]
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. def executeRequest(conn: Connection): Response
    Attributes
    protected[this]
  12. def get(url: String): JsoupDocument

    Retrieves and parses a web page using a GET request.

    Retrieves and parses a web page using a GET request.

    url

    the URL of the page to retrieve

    returns

    a Document containing the retrieved web page.

    Definition Classes
    JsoupBrowserBrowser
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  19. def parseFile(file: File, charset: String): JsoupDocument

    Parses a local HTML file with a specified charset.

    Parses a local HTML file with a specified charset.

    file

    the HTML file to parse

    charset

    the charset of the file

    returns

    a Document containing the parsed web page.

    Definition Classes
    JsoupBrowserBrowser
  20. def parseFile(path: String): DocumentType

    Parses a local HTML file encoded in UTF-8.

    Parses a local HTML file encoded in UTF-8.

    path

    the path in the local filesystem where the HTML file is located

    returns

    a Document containing the parsed web page.

    Definition Classes
    Browser
  21. def parseFile(path: String, charset: String): DocumentType

    Parses a local HTML file with a specified charset.

    Parses a local HTML file with a specified charset.

    path

    the path in the local filesystem where the HTML file is located

    charset

    the charset of the file

    returns

    a Document containing the parsed web page.

    Definition Classes
    Browser
  22. def parseFile(file: File): DocumentType

    Parses a local HTML file encoded in UTF-8.

    Parses a local HTML file encoded in UTF-8.

    file

    the HTML file to parse

    returns

    a Document containing the parsed web page.

    Definition Classes
    Browser
  23. def parseInputStream(inputStream: InputStream, charset: String): JsoupDocument

    Parses an input stream with its content in a specified charset.

    Parses an input stream with its content in a specified charset. The provided input stream is always closed before this method returns or throws an exception.

    inputStream

    the input stream to parse

    charset

    the charset of the input stream content

    returns

    a Document containing the parsed web page.

    Definition Classes
    JsoupBrowserBrowser
  24. def parseResource(name: String, charset: String = "UTF-8"): DocumentType

    Parses a resource with a specified charset.

    Parses a resource with a specified charset.

    name

    the name of the resource to parse

    charset

    the charset of the resource

    returns

    a Document containing the parsed web page.

    Definition Classes
    Browser
  25. def parseString(html: String): JsoupDocument

    Parses an HTML string.

    Parses an HTML string.

    html

    the HTML string to parse

    returns

    a Document containing the parsed web page.

    Definition Classes
    JsoupBrowserBrowser
  26. def post(url: String, form: Map[String, String]): JsoupDocument

    Submits a form via a POST request and parses the resulting page.

    Submits a form via a POST request and parses the resulting page.

    url

    the URL of the page to retrieve

    form

    a map containing the form fields to submit with their respective values

    returns

    a Document containing the resulting web page.

    Definition Classes
    JsoupBrowserBrowser
  27. def processResponse(res: Response): JsoupDocument
    Attributes
    protected[this]
  28. val proxy: java.net.Proxy
  29. def requestSettings(conn: Connection): Connection
  30. def setCookie(url: String, key: String, value: String): Map[String, String]
  31. def setCookies(url: String, m: Map[String, String]): Map[String, String]
  32. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  33. def toString(): String
    Definition Classes
    AnyRef → Any
  34. val userAgent: String

    The user agent used by this browser to retrieve HTML pages from the web.

    The user agent used by this browser to retrieve HTML pages from the web.

    Definition Classes
    JsoupBrowserBrowser
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  37. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  38. def withProxy(proxy: Proxy): JsoupBrowser

    Returns a new browser that uses the provided proxy for all connections.

    Returns a new browser that uses the provided proxy for all connections.

    Definition Classes
    JsoupBrowserBrowser

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Browser

Inherited from AnyRef

Inherited from Any

Ungrouped