本帖最后由 pcl_test 于 2015-6-26 18:35 编辑
保存为bat文件运行- '&cls&@echo off&for /f "delims=" %%a in ('cscript -nologo -e:vbscript %~fs0') do >$查找结果.txt echo %%a&pause&exit /b
- url = "http://www.taobao.com"
- Set http = CreateObject ("Microsoft.XMLHTTP")
- http.Open "GET", url, false
- http.Send
- txt = http.responseText
- Set re = New RegExp
- '支持正则表达式
- re.Pattern = "家居"
- re.Global = true
- If Not re.Test(txt) Then wscript.echo("未找到")
- For Each m in re.Execute(txt)
- wscript.echo url
- Exit For
- Next
复制代码
|