请问用什么办法可以取到网页中的IP列表【已经解决】
本帖最后由 loveauto 于 2012-9-12 15:58 编辑网址http://www.free998.net/daili/httpdaili/5998.html
请问如何才能获取到呀,正则表达式不了解,解析了半天弄不出来,另外一种办法 通过_IETagNameGetCollection
找到form标签,那怎么报这个标签显示在网页在的值都获取下来。求高手指导下。 正则吧~!~
<table width="100%">
<tbody><tr><td><div>代理<span style="white-space: pre;" class="Apple-tab-span"> </span>端口<span style="white-space: pre;" class="Apple-tab-span"> </span>国家</div>
<div>1<span style="white-space: pre;" class="Apple-tab-span"> </span>dev.www.lawson.com<span style="white-space: pre;" class="Apple-tab-span"> </span>80<span style="white-space: pre;" class="Apple-tab-span"> </span>US</div>
<div>2<span style="white-space: pre;" class="Apple-tab-span"> </span>ocs.lawson.com<span style="white-space: pre;" class="Apple-tab-span"> </span>80<span style="white-space: pre;" class="Apple-tab-span"> </span>US</div>
<div>3<span style="white-space: pre;" class="Apple-tab-span"> </span>101.44.1.22<span style="white-space: pre;" class="Apple-tab-span"> </span>80<span style="white-space: pre;" class="Apple-tab-span"> </span>CN</div>
<div>4<span style="white-space: pre;" class="Apple-tab-span"> </span>210.51.38.14<span style="white-space: pre;" class="Apple-tab-span"> </span>80<span style="white-space: pre;" class="Apple-tab-span"> </span>CN</div>
<div>5<span style="white-space: pre;" class="Apple-tab-span"> </span>221.7.159.224<span style="white-space: pre;" class="Apple-tab-span"> </span>8080<span style="white-space: pre;" class="Apple-tab-span"> </span>CN</div>
<div>6<span style="white-space: pre;" class="Apple-tab-span"> </span>210.13.105.23<span style="white-space: pre;" class="Apple-tab-span"> </span>8080<span style="white-space: pre;" class="Apple-tab-span"> </span>CN</div>
<div>7<span style="white-space: pre;" class="Apple-tab-span"> </span>210.32.137.34<span style="white-space: pre;" class="Apple-tab-span"> </span>9797<span style="white-space: pre;" class="Apple-tab-span"> </span>CN</div>
<div>8<span style="white-space: pre;" class="Apple-tab-span"> </span>202.108.77.153<span style="white-space: pre;" class="Apple-tab-span"> </span>80<span style="white-space: pre;" class="Apple-tab-span"> </span>CN</div>
<div>9<span style="white-space: pre;" class="Apple-tab-span"> </span>60-248-215-231.hinet-ip.hinet.net<span style="white-space: pre;" class="Apple-tab-span"> </span>8080<span style="white-space: pre;" class="Apple-tab-span"> </span>TW</div>
<div>10<span style="white-space: pre;" class="Apple-tab-span"> </span>124.74.255.104<span style="white-space: pre;" class="Apple-tab-span"> </span>83<span style="white-space: pre;" class="Apple-tab-span"> </span>CN</div>
<div>11<span style="white-space: pre;" class="Apple-tab-span"> </span>124.74.255.104<span style="white-space: pre;" class="Apple-tab-span"> </span>81<span style="white-space: pre;" class="Apple-tab-span"> </span>CN</div>
<div>12<span style="white-space: pre;" class="Apple-tab-span"> </span>im.lawson.com<span style="white-space: pre;" class="Apple-tab-span"> </span>80<span style="white-space: pre;" class="Apple-tab-span"> </span>US</div>
<div>13<span style="white-space: pre;" class="Apple-tab-span"> </span>certowa.lawson.com<span style="white-space: pre;" class="Apple-tab-span"> </span>443<span style="white-space: pre;" class="Apple-tab-span"> </span>US</div>
<div>14<span style="white-space: pre;" class="Apple-tab-span"> </span>114.30.47.10<span style="white-space: pre;" class="Apple-tab-span"> </span>80<span style="white-space: pre;" class="Apple-tab-span"> </span>TW<span style="white-space: pre;" class="Apple-tab-span"></span></div></td></tr>
</tbody></table>
先把这部份取出来 把<table>这个取出来我到已经取出来了,最土的方式字符串查找都可以。
取出来后如何取就不知道了 知道了,还是正则表达式
$sHTML= StringReplace($sHTML,'<span class="Apple-tab-span" style="white-space:pre"> </span>','')
$sHTML= StringReplace($sHTML,'<SPAN style="WHITE-SPACE: pre" class=Apple-tab-span> </SPAN>',':')
$sHTML =StringRegExpReplace($sHTML,'\r\n','')
Local $ProxyArray = StringRegExp($sHTML, '\d+\.\d+\.\d+\.\d+:\d+', 3) 非常感谢 绿色风 happyplace
页:
[1]