Context: I need to obtain information from a bunch of data in a web app. I do not use API because obtaining an API key would be too much of an issue. Therefore I decided to start using the chrome dev tools also as you'll see I am a complete beginner with this tool but recognize it's utility.
Problem: I found the table element that holds all the information that I want in my case I only want one column of that table. (I obtain the JS Path with that purpose) I read the elements in the dev tools and the syntax is the next one(copying the JS path):
document.querySelector (#WorkflowSchemes > div > div.legacy-jira-fe-module.toggle-wrap.expanded > div.mod-content > table > body > tr:nth-child(1) > td > strong")
Pasting the obtained JS path and adding the .innerText into the console of chrome gives me one of the 200 text elements that I need. What I need to do is iterate the (tr:nth-child(1)) node. To end up grabbing all the 200 text elements I need.
What I have at the moment:
var cycle =function (cycleCommand){while(let i = 1 < 200){
console.log(document.querySelector (#WorkflowSchemes > div > div.legacy-jira-fe-module.toggle-wrap.expanded > div.mod-content > table > body > tr:nth-child("i") > td > strong").innerText
}
var cycle = function (cycleTest)
for (let index = 0; index < 200: index++){
document.querySelector("WorkflowSchemes > div > div.legacy-jira-fe-module.togle-wrap.expanded > div.mod-content > table > tbody> tr:nth-child (("index")) > td > strong")
}
I hope the problem is understandable please let me know if you know a way to do this.
Thanks!
If I understand correctly, you want a collection of all the strong elements in the table that are direct children of td elements in the tbody:
document.querySelectorAll('#WorkflowSchemes > div > div.legacy-jira-fe-module.toggle-wrap.expanded > div.mod-content > table > tbody > tr > td > strong')
is going to give you an array-like list of the nodes.