Board logo

标题: [文件操作] 批处理怎样将网页中包含指定字符串之外的删除实现批量下载? [打印本页]

作者: SEAL618    时间: 2011-3-11 12:56     标题: 批处理怎样将网页中包含指定字符串之外的删除实现批量下载?

将网页中包含*.swf之外的全部删除 然后将有用地址保存到URL.LST中
@echo off
setlocal enabledelayedexpansion
for/f "delims="%%a in('dir/b*.shtml') do(
for/f "tokens=2 delims="%%i in(%%a) do(
set str=%%i
set str=!str:"=!
set str =!str:*http=http!
if "!str:~-3!"=="swf"(echo!str!>>url.lst)
)
)
pause
这是我在网上找的一段代码 请大家帮忙看看 双击之后没有任何反应
网页是shtml格式的

[ 本帖最后由 SEAL618 于 2011-3-11 13:12 编辑 ]
作者: CrLf    时间: 2011-3-11 13:18

有捷径不用,吃力不讨好
  1. @echo off
  2. findstr>url.list /m ".*\.swf" *.shtml
  3. for /f "delims=" %%a in ('dir /b *.txt^|findstr /v /g:1.txt') do del "%%a"
复制代码

作者: SEAL618    时间: 2011-3-11 13:40     标题: 回复 2楼 的帖子

你好 我将您提供的代码弄了一个BAT 结果是
1.shtml
10.shtml
11.shtml
12.shtml
13.shtml
14.shtml
2.shtml
3.shtml
4.shtml
5.shtml
6.shtml
7.shtml
8.shtml
9.shtml
而我是想将每一个网页中包含http://images.enet.com.cn/eschool/vb/73192.swf 这部分提取出来地址放到url.lst中
作者: SEAL618    时间: 2011-3-11 14:43

各位朋友帮忙看看吧
作者: Batcher    时间: 2011-3-11 19:32

能否选一个网页文件以附件的形式上传到顶楼?以便他人测试
作者: SEAL618    时间: 2011-3-13 11:30

上传不了RAR的附件啊 管理员
作者: Batcher    时间: 2011-3-13 11:39     标题: 回复 6楼 的帖子

改个后缀名很困难么?




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2