I am wondering if there is a way to save the entire console to a file using javascript. I am outputting to the console a counter number and the text of a div which repeats itself x amount of times depending on how many divs are on the page and I want to save everything that is in the console. My console looks something like this:
Div: 34 | Title: Some Title
Div: 35 | Title: Some Other Title
Div: 36 | Title: Yet Another Title
I would like to save all those lines to a file using javascript. So that it does it automatically when the divs are done being displayed. Is there a way to do this? Thank you for your time.
Edit: https://jsfiddle.net/u4ohzofk/
var titles = $('.title');
for(i = 0; i < titles.length; i++) {
console.log("Div: "+i+" | Title: "+$(titles[i]).text());
}
<div class="title">
Here is a title
</div>
<div class="title">
Here is a title2
</div>
<div class="title">
Here is a title3
</div>
<div class="title">
Here is a title4
</div>
<div class="title">
Here is a title5
</div>
<div class="title">
Here is a title6
</div>
<div class="title">
Here is a title7
</div>
<div class="title">
Here is a title8
</div>
<div class="title">
Here is a title9
</div>
<div class="title">
Here is a title10
</div>
I have created the above fiddle to further help me explain what I am looking for. I have divs with titles that I get off of a page. I number the divs and grab their titles and then spit that out into the console. I then want to save the entire console when it is done spitting out the divs. I want to do this automatically through javascript. Not manually. I am also not just inputting this into a variable because other elements are automatically displaying to the console that I am looking to save as well.