[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 批处理如何获取网页源码中的 <a>标签中的内容?

求助获 如何取网页源码。中的 <a>标签中的内容。。
这样的 TXT 获取       代码都在一行里面!
求 正则表达式 查找。。。。

标签头
http://g6612843.blog.163.com/blog/static/45846717201151194911983

<span class="line">-</span><a href="http://g6612843.blog.163.com/blog/static/45846717201151194911983" >标签头</a></div><div class="sp"><span class="preview" id="pws_0_1"><span class="iPre"><span class="iPreBox" style="height:74px;"><em class="iPreArr"></em></span><span class="line">-</span><a href="http://g6612843.blog.163.com/blog/static/45846717201151194911983" >标签头</a></div><div class="sp"><span class="preview" id="pws_0_1"><span class="iPre"><span class="iPreBox" style="height:74px;"><em class="iPreArr"></em></span><span class="line">-</span><a href="http://g6612843.blog.163.com/blog/static/45846717201151194911983" >标签头</a></div><div class="sp"><span class="preview" id="pws_0_1"><span class="iPre"><span class="iPreBox" style="height:74px;"><em class="iPreArr"></em></span>

VBS 一个  这样可以吗
  1. Dim ie
  2. Set ie = CreateObject("InternetExplorer.Application")
  3. Set FSO=CreateObject("Scripting.FilesystemObject")
  4. file = "c:\a.html"
  5. ie.NaviGate file
  6. for i = 0 to ie.document.links.length-1
  7. str = str & ie.document.links(i).outerText & vbCrLf & ie.document.links(i).href & vbCrLf
  8. next
  9. ie.quit
  10. Set ie = Nothing
  11. FSO.OpenTextFile("html.txt",2,True).WriteLine str
复制代码

TOP

返回列表