Question

A website only shows some links after clicking on some buttons, but you can trigger these buttons using the js-console of Chrome.

Command:

expandPack('S151')

Basically, the only thing that changes to get the other links is the number (in the example 151)

So how can I use a for loop to get all links with the ids 1-300?

Était-ce utile?

La solution

A standard loop...

for (var i = 1; i <= 300; i++) {
    expandPack("S" + i);
}

Autres conseils

Are you saying you want to do this:

for(var i = 1; i <= 300; i += 1) {
    expandPack('S' + i);
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top