XPathOnUrl using Substring()

Hey there,
Coding beginner here. I tried to use the XPathOnUrl to retrieve part of a string using Substring(), however I can't seem to get anything other than an Excel #VALUE error.

HTML CODE:

<!DOCTYPE html>
<html lang="en-gb" class="no-js logged-in client-root">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">

        <title>
Peter was here
</title>

............

Excel Formula that I'm using:
=@Dump(XPathOnUrl(A4,"substring(/html/head/title,5)",,,"text"))

Now, retrieving the whole string using "/html/head/title" is working using XPathOnUrl, however, when adding Substring() an error appears. Did I make a mistake in my XPath?

Let me know if you need any additional info. I appreciate any help!

Hi, I don't believe substring is supported as an operator within the XPathOnUrl argument. Perhaps try to use the built in Excel string functions such as Left()?