如何把网页中的代码 替换成空格或去掉,求教

xjgcyq 2005-10-12 08:51:58
如把网页的所有的<span class="baise">.............</span>去掉
...全文
183 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xjgcyq 2005-10-13
  • 打赏
  • 举报
回复
老大怎么调用呀!我试了一下好像不行呀!
northwolves 2005-10-12
  • 打赏
  • 举报
回复
上面代码没有调试,感觉应该没问题
northwolves 2005-10-12
  • 打赏
  • 举报
回复
'x为读到的网页源码
Function trans(ByVal x As String) As String
Dim temp() As String, temp2() As String, i As Integer
x = Replace(x, "</span>", "<span")
temp = Split(x, "<span")
ReDim temp2(UBound(temp) / 2)
For i = 0 To UBound(temp) / 2
temp2(i) = temp(i * 2)
Next
x = Join(temp2, " ")
Erase temp
Erase temp2
End Function

1,502

社区成员

发帖
与我相关
我的任务
社区描述
VB 网络编程
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧