找回密码
 加入
搜索
查看: 2313|回复: 5

[网络通信] 请问用什么办法可以取到网页中的IP列表【已经解决】

[复制链接]
发表于 2012-9-12 10:22:59 | 显示全部楼层 |阅读模式
本帖最后由 loveauto 于 2012-9-12 15:58 编辑

网址  http://www.free998.net/daili/httpdaili/5998.html
请问如何才能获取到呀,正则表达式不了解,解析了半天弄不出来,另外一种办法 通过_IETagNameGetCollection
找到form标签,那怎么报这个标签显示在网页在的值都获取下来。求高手指导下。
发表于 2012-9-12 10:52:57 | 显示全部楼层
正则吧~!~
发表于 2012-9-12 12:48:25 | 显示全部楼层
 
                 <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> 
先把这部份取出来
 楼主| 发表于 2012-9-12 13:31:40 | 显示全部楼层
把<table>这个取出来我到已经取出来了,最土的方式字符串查找都可以。
取出来后如何取就不知道了
 楼主| 发表于 2012-9-12 15:48:24 | 显示全部楼层
知道了,还是正则表达式

        $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)
 楼主| 发表于 2012-9-12 15:49:04 | 显示全部楼层
非常感谢 绿色风    happyplace
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-18 17:31 , Processed in 0.076704 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表