BreadCrumbs: JavaScript
JavaScript
From Luke Jackson
Revision as of 16:07, 6 October 2020; Ljackson (Talk | contribs)
(diff) ←Older revision | Current revision | Newer revision→ (diff)
(diff) ←Older revision | Current revision | Newer revision→ (diff)
XPath
count(//td[text() ="Men's XL"]) //td[text() ="Men's XL"] //td[8] //option/@value | //select/@id | //input/@id | //select/optgroup/@label | //option/text()
Chrome, Firefox Xpath
Open developer tools to access the console and use the xpath function call to iterate the array of option items for the select object. Log them to the console using a for each function loop.
$x('//*[@id="miles"]/option/text()').forEach(function(el){console.log(el)});
Export p element text
$x('//p/text()').forEach(function(el){console.log(el)});
Sources: