parseFile

fun KtSoupParser.parseFile(pathString: String, bufferSize: Int = DEFAULT_PARSE_BUFFER_SIZE): KtSoupDocument

Parse the HTML document at pathString or throw if it does not exist.

Return

The parsed document as a KtSoupDocument.

Parameters

pathString

The file path as a string.

bufferSize

An optional size for the buffer to use while reading the file, default is 1024.

Throws

IOException

If the file does not exist or is unreadable.


fun KtSoupParser.parseFile(path: Path, bufferSize: Int = DEFAULT_PARSE_BUFFER_SIZE): KtSoupDocument

Parse the HTML document at path or throw if it does not exist.

Return

The parsed document as a KtSoupDocument.

Parameters

path

The file path as a kotlinx-io Path.

bufferSize

An optional size for the buffer to use while reading the file, default is 1024.

Throws

IOException

If the file does not exist or is unreadable.