SHARE
TWEET

mime scraper

banepwn Jan 24th, 2020 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types
  2. var table = document.querySelector("table tbody");
  3. var rows = table.querySelectorAll("tr");
  4. var output = ""
  5. for (i=0; i<rows.length; i++) {
  6.     var row = rows[i];
  7.     var extension = row.querySelector("td:first-child code").innerText;
  8.     var mime = row.querySelector("td:last-child code").innerText;
  9.     output = output+'\t"'+extension+'": "'+mime+'",\n';
  10. }
  11. console.log(output);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top