Advertisement
rgruber

asn-info [querySelector]

Jul 3rd, 2022 (edited)
620
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.52 KB | None
  1. // #ipv4-data
  2. document.querySelectorAll("#ipv4-data table tbody tr ").forEach(v =>{console.log(
  3.    
  4.     v.children[0].innerText.trim()
  5.     ,v.children[1].firstChild.nextElementSibling.className.replace("flag flag-","").toUpperCase()
  6.     ,v.children[1].innerText.trim(),
  7.     parseInt(v.children[2].innerText.trim().replace(",",""))
  8. );
  9.                                                              
  10.                                                                                                                            
  11. })
  12.  
  13. console.log([...document.querySelectorAll("#block-peers table tbody tr td")].map(v=>v.innerText.trim()));
  14. console.log([...document.querySelectorAll("#block-upstreams table tbody tr td")].map(v=>v.innerText.trim()));
  15. console.log([...document.querySelectorAll("#block-downstreams table tbody tr td")].map(v=>v.innerText.trim()));
  16. console.log([...document.querySelectorAll("#block-summary table tbody tr td")].map(v=>v.innerText));
  17. console.log([...document.querySelectorAll("#ipv6-data table tbody tr td")].map(v=>v.innerText.trim()));
  18. console.log([...document.querySelectorAll("#block-domains tr td")].map(v=>v.innerText.trim()));
  19. console.log(document.querySelector('#block-domains > div > p > small').innerText.trim());
  20. console.log(document.querySelector('#block-summary > div > h2').innerText.trim());
  21.  
  22. console.log("x");
  23. // https://ipinfo.io/AS174
  24.  
  25. for (var i=0,l=[...document.querySelectorAll("#block-summary table tbody tr td")].map(v=>v.innerText);i<l.length;i+=2) {
  26.     console.log(l[i],l[i+1]);
  27. }
Advertisement
RAW Paste Data Copied
Advertisement