function getElementByXPath(path, context=null, _document=undefined) {
if( _document === undefined ) _document = document;
let res = document.evaluate(path, _document, context, XPathResult.FIRST_ORDERED_NODE_TYPE);
if( !res ) return null;
return res.singleNodeValue;
}
function getTextByXPath(path, context=null, _document=undefined) {
let e = getElementByXPath(path, context, _document);
if( !e ) return undefined;
return e.textContent;
}
function getTextByQuerySelector(selector) {
let e = document.querySelector(selector);
if( !e ) return undefined;
return e.textContent;
}