[JS] a regular to get the page IP

Time:2022-5-9

See one, there are always people checking IP and writing it at will

The code is as follows:

Javascr ī pt:var arr=document. body. innerText. match(/(\d{1,3}\.) {3}/g); var str=””; var ip; for(var i=0;i<arr.length;i++){ip=arr[i]+Math.floor(Math.random()*255);str+=”<li>”+ip+”  <a href=’ http://www.baidu.com/baidu?word= “+ IP +” > obtain the IP source < / a > < / Li > “;} if (arr.length > 0) {document. Write (” < br > < ol > “+ STR)};