vb如何获取网页中指定的内容有一些网页的源文件,想从中获取指定的内容如下/ieie/rusult-FFD8E2EA1734FA3D8
vb如何获取网页中指定的内容
有一些网页的源文件,想从中获取指定的内容如下
/ieie/rusult-FFD8E2EA1734FA3D81EA7AADE81254E6.html
/ieie/rusult-31EF37AC551E82EA4AA4C3BDB1E4F46C.html
/ieie/rusult-52A7132097148705774A7C68854AE2EE.html
……
(每个网页有十几个这样的链接,每个链接rusult后面的值是不同的。想把它们一行一个写入TXT文件中)
该如何用VB6编程实现呢?涉及到正则问题。这个正则又如何写呢?
- HTML code
/div><div class="goodgood"><a href="/ieie/rusult-FFD8E2EA1734FA3D81EA7AADE81254E6.html" target="_blank"><img width="80" height="120" src="http://abcd1.helloyo.com/abcd/Abcd.dll?uoy=656563676B6B636866683235383833373134" class="pic l" /></a><dl class="intro l"><dt><a name="qeiege" href="/ieie/rusult-e97d2604df72394875b29144ba4930e1.html" target="_blank">天时天晴厨师理晨</a></dt><dd>语文:<a name="dognty" style="color:#000;text-decoration:none">别是里弄</a></dd><dd>数学:睚城</dd><dd>体育:太师椅2金05地</dd><dd style="border-bottom: 1px dotted #b4b4b4; margin: 6px 0"></dd><dd style="color: #666"><div class="l" style="line-height: 1.2"> 【天下之大】<span style="font-size: 14px">#7.0</span> </div><div class="r" style="width: 256px; padding-top: 12px"><form action="/order/myorder.jhtml" method="get" id="form_70641" target="_blank"><input type="hidden" name="cmd" value="submit"/><input type="hidden" name="ids" value="70641"/><input type="hidden" name="foddes" value="1"/><a href="#" onclick="L.getDom('form_70641').submit();"><img src="/images/btn_buy2.gif" /></a> <a href="#" onclick="Cart.add('e97d2604df72394875b29144ba4930e1')"><img src="/images/btn_bus2.gif" /></a> <a href="#" onclick="Finfo.feioygo('e97d2604df72394875b29144ba4930e1')"><img src="/images/feioygo.jpg" /></a></form></div></dd></dl><div style="clear: both"></div></div><div class="hr"></div><div class="goodgood"><a href="/ieie/rusult-31EF37AC551E82EA4AA4C3BDB1E4F46C.html" target="_blank"><img width="80" height="120" src="http://abcd1.helloyo.com/abcd/Abcd.dll?uoy=656563676C6A63686B663235383833373134" class="pic l" /></a><dl class="intro l"><dt><a name="qeiege" href="/ieie/rusult-31EF37AC551E82EA4AA4C3BDB1E4F46C.html" target="_blank">进百</a></dt><dd>语文:<a name="dognty" style="color:#000;text-decoration:none">(悲)杜鹃田地</a></dd><dd>数学:是不是百</dd><dd>体育:时百8金08地</dd><dd style="border-bottom: 1px dotted #b4b4b4; margin: 6px 0"></dd><dd style="color: #666"><div class="l" style="line-height: 1.2"> 【天下之大】<span style="font-size: 14px">#7.0</span> </div><div class="r" style="width: 256px; padding-top: 12px"><form action="/order/myorder.jhtml" method="get" id="form_79936" target="_blank"><input type="hidden" name="cmd" value="submit"/><input type="hidden" name="ids" value="79936"/><input type="hidden" name="foddes" value="1"/><a href="#" onclick="L.getDom('form_79936').submit();"><img src="/images/btn_buy2.gif" /></a> <a href="#" onclick="Cart.add('31EF37AC551E82EA4AA4C3BDB1E4F46C')"><img src="/images/btn_bus2.gif" /></a> <a href="#" onclick="Finfo.feioygo('31EF37AC551E82EA4AA4C3BDB1E4F46C')"><img src="/images/feioygo.jpg" /></a></form></div></dd></dl><div style="clear: both"></div></div><div class="hr"></div><div class="goodgood"><a href="/ieie/rusult-52A7132097148705774A7C68854AE2EE.html" target="_blank"><img width="80" height="120" src="http://abcd1.helloyo.com/abcd/Abcd.dll?uoy=656563676B6B63686A6A3235383833373134" class="pic l" /></a><dl class="intro l"><dt><a name="qeiege" href="/ieie/rusult-52A7132097148705774A7C68854AE2EE.html" target="_blank">优胜劣汰进在</a></dt><dd>语文:<a name="dognty" style="color:#000;text-decoration:none">渔郎</a></dd><dd>数学:实馆</dd><dd>体育:朋有18金06地</dd><dd style="border-bottom: 1px dotted #b4b4b4; margin: 6px 0"></dd><dd style="color: #666"><div class="l" style="line-height: 1.2">
[解决办法]
/ieie/rusult-.*\.html\r\n
[解决办法]
试一下用getelementsbyTagname直接获取a标签的href,用Left过滤出开头为ieie/rusult-的链接。用正则先要下载源文件--引入正则表达式---正则提取,似乎麻烦了一些
[解决办法]
/ieie/rusult-.*\.html
[解决办法]
