0

Given a webpage with a list of items spread across multiple pages, how do I get/save/copy all the information from Inspect Element?

What I'm doing now: Click on page 1, copy Inspect, Click page 2, copy Inspect, Page 3, copy and so on until I reach the last page.

How I want to do it: Click on page 1/2/3/4/.../# and copy/save inspect element once, at the end; or something as fast so I don't have to copy every page manually.


EDIT (trying to clear-out my issue):

What I want to copy (highlighted in light blue)

So, I want to copy (lets say) the < ul class > tree from every page; but for me to do that, I need to copy the Element every time I switch to a different page (from a list of many product pages). How can I copy the elements from all these pages faster, without having to copy elements from one page at a time?

  • You should clarify in your question what exactly you want to copy. E.g. if you want to get the HTML contained within the inspected element, you can get it via [`innerHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML). If the inspected element should be included, you can get it via [`outerHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/outerHTML). Or do you also need the CSS related to the inspected elements? – Sebastian Zartner Mar 21 '17 at 09:25
  • I edited my post to try explaining it better. – Alex Mercer Mar 21 '17 at 09:41

1 Answers1

0

I managed to do it by using an automated jQuery script.

Var time = 2000;
Var jumpT = 2000;
Var nr_pages = 30;
Var final = ‘’;
Var U = 0;
For (I = 0; I < nr_pages; I++) { //loop as many pages as you like

                setInterval(function() {

                var result = $("ul.Products").map(function () { //this grabs the current inspect from the current page
                        return this.innerHTML;
                }).get().join('NextValue');

                Final += result;

                $(“.a.page-button.next”).click(); //go to the next page

                U += 1;
                Console.log(‘I'm at page ‘+ u);

                }, time); //page jump delay

                time += jumpT;

}

Now, the whole content is in Final