我正在使用此脚本来获取src值。
for /f "tokens=2 delims=[] " %%a in('find "src=" ^< "test2.html" ')do echo "%%a"
输出如下:src =“homepage / explore / color_factory.js”&gt;
但我想这样:来自此主页/ app.js
test2.html:
<script src="homepage/app.js"></script>
<script src="homepage/color_factory.js"></script>
<script src="homepage/config.js"></script>
答案 0 :(得分:0)
试试这样:
@echo off
for /f "tokens=2 delims==^>" %%a in ('type test.html ^| find "src="') do echo %%~a