Thursday, December 15, 2016

Enabling jQuery to Lookup in Simple Page (in console)

Assuming the loaded page is simple page like the apache directory list as known as "index of /..."
No jquery is there, just the core javascript by browser

Loading jQuery:
var s = document.createElement('script');
s.setAttribute('src', 'http://code.jquery.com/jquery-latest.min.js');
document.body.appendChild(s)

Now using jquery to do your stuff like finding the links
var links = $('a[href*="1080"]')
for(var i = 0; i < links.length; i++) {
  if(links[i].href.indexOf('x265') > 0)
    console.log(links[i].href);
}

No comments: