Skip to content

Instantly share code, notes, and snippets.

@lmgeorge
Created May 16, 2017 01:34
Show Gist options
  • Save lmgeorge/ac866fa394deb6a6d3b4800615d20f3f to your computer and use it in GitHub Desktop.
Save lmgeorge/ac866fa394deb6a6d3b4800615d20f3f to your computer and use it in GitHub Desktop.
Using XPATH w/ JS
var div = document.createElement('div');
var result;
div.innerHTML = $('.tpSubtitleRegion_speaker .gwt-HTML').prop('innerHTML');
result = document.evaluate("//text()", div, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for(var i=0; i < result.snapshotLength; i++) {
console.dir(result.snapshotItem(i));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment