These instructions assume you have experience building and running real browser testcases, including creating and editing real browser steps from scratch. I also assume you have at least a passing familiarity with Javascript. You can get at the page source, and perform arbitrary operations on it, using an "Execute Javascript" step. Inside the step editor, the following will work as starter script:


function execute(context)
{
    // Regex that we want to search in the page source:
    var regex = /DOCTYPE [a-zA-Z]+/;
    var result = String(context.getDriver().getPageSource()).match(regex)[0];

    // save the result to the user state variable "foo"
    context.getUserState().setVariable('foo', result);
}


The result will be a user state variable "foo" set to the DOCTYPE string of the document (not particularly useful, but you can change the regex to something meaningful to you). You can then apply the value using any "User Variable" datasource, or in another scripted action by calling getVariable('foo') on the user state. There's no way to test the script except to just run it.


Note: generally, in a real browser testcase, extracting a user state variable is equivalent to asking your human user to memorize and later type back to you some value they see on the screen. In most cases, you will never need to extract any value from a real browser testcase.


Note also: Load Tester also has the ability to extract the text of an element located using the capabilities of the GUI editor. Use an "Extract a value" step to create such an extractor.