V
V
viktorleg2016-04-27 19:48:34
JavaScript
viktorleg, 2016-04-27 19:48:34

How to find all .pdf website files through browser console?

Guys, hello!
How to find .pdf files that are stored on the site through the browser console?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Belyaev, 2016-04-27
@bingo347

The question, of course, is that I want to send to study javascript and what it can do in the browser
But still, let's povang ... there is a certain site, on one of its pages there are several links to .pdf documents, you want to collect the url of these links using the console, guessed it ?
If guessed:

Array.prototype.map.call(document.getElementsByTagName('a'), function(link) {
  return link.href;
}).filter(function(url) {
  return url.endsWith('.pdf');
});

D
Dark Hole, 2016-04-27
@abyrkov

*punches my face*
Are you learning Lin's console?
Yes, there are no such commands. There is (in the debugger) a list of downloaded files, but I assume you mean links.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question