In the website I’m accessing, there is a javascript array (var arrayname) that has 500 elements, but the website only gives me an option to display ten at a time.
I’ve tried using the Chrome console: I can type “arrayname” and it will display a tree of the entire array, but not in a way that I can extract the information I need efficiently.
How can I download the array so that I can extract the data in each element myself using a parser? My goal is simply to put the contents of the array into a text file that I can then put into Excel.
–edit–
The array is actually an array of 5-element arrays. The console output also divides the 500-element array into smaller ranges of arrays that you have to click to step into. I would display the screenshot, but I don’t have enough reputation yet! Here’s the text of the output, not formatted.
> arrayname
Array[500]
[0 … 24]
[0 … 4]
0: Array[5]
0: "data1" //sample output - this is the element i actually want to extract
1: "data2" //sample output
2: "data3" //sample output
3: "data4" //sample output
4: "data5" //sample output
length: 5
__proto__: Array[0]
1: Array[5]
2: Array[5]
3: Array[5]
4: Array[5]
[5 … 9]
[10 … 14]
[15 … 19]
[20 … 24]
[25 … 49]
[50 … 74]
[75 … 99]
[100 … 124]
[125 … 149]
[150 … 174]
[175 … 199]
[200 … 224]
[225 … 249]
[250 … 274]
[275 … 299]
[300 … 324]
[325 … 349]
[350 … 374]
[375 … 399]
[400 … 424]
[425 … 449]
[450 … 474]
[475 … 499]
length: 500
__proto__: Array[0]
In the chrome console you can use the builtin copy command:
And you’ll have the array copied to your clipboard, 1 element per line.