Skip to content

HTMLExtract

Francesco edited this page Mar 31, 2018 · 33 revisions

Introduced in t-ui beta 6.5.5.

This feature let's you extract text from HTML pages and display it inside t-ui.

XPath

XPath is a language used to find particular nodes and tags in HTML/XML documents. It's very easy to understand, and very powerful.

Format

Values:

  • %n -> newline

  • %t -> tag name

  • %t(attributeName) -> the value of the attribute attributeName of the matched node

  • %a(format)(separator) -> prints every attribute of the matched nodes

    • %an -> attribute name
    • %av -> attribute value
  • %v -> tag value

  • #[URL] -> link

  • #rrggbb[text] -> color the text

Example

Matched node:
<a href="https://github.com/Andre1299/TUI-ConsoleLauncher/subscription" class="myClass" role="button">This is a link</a>

Example 1

Format:
#[%t(href)]

Output:
https://github.com/Andre1299/TUI-ConsoleLauncher/subscription

Example 2

Format:
%t -> %v%n%a(%an = %av)(%n)

Output:

a -> This is a link
href = https://github.com/Andre1299/TUI-ConsoleLauncher/subscription
class = myClass
role = button

Clone this wiki locally