网页自动执行脚本_网页自动执行脚本

网页自动执行脚本_网页自动执行脚本在Windows下使用bat脚本批量打开网页,记录一下实现过程

网页自动执行脚本_网页自动执行脚本"

在Windows下使用bat脚本批量打开网页,记录一下实现过程。

使用同一个浏览器有两种方式:
方式1是通过浏览器名直接打开该浏览器;
方式2是通过浏览器的绝对路径打开该浏览器。

当使用绝对路径时需要注意的问题:
1、如果该绝对路径中没有空格,没有中文字符,则可以直接使用该路径。例子:正文目录中的1.2.1和1.5.1。
2、如果包含中文字符,则需在bat第一行加入chcp 65001,才能成功打开该路径。例子:正文目录中的1.4.2。
3、如果包含空格,则需要加引号。例子:正文目录中的1.1.2和1.3.2。

一、使用不同浏览器批量打开网址

1.1 使用Edge批量打开网页

1.1.1 方式1:使用浏览器名字microsoftedge

首先新建一个txt文件,改名为open_edge.bat,右键 -> 编辑。
将以下命令复制进去:

@echo off title open web timeout /nobreak /t 5 start microsoftedge "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start microsoftedge "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start microsoftedge "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start microsoftedge "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start microsoftedge "https://blog.csdn.net/AnChenliang_1002/article/details/" Echo. Echo open web Number is 5 Echo. timeout /nobreak /t 30 

保存,退出,双击运行即可。
代码解释:
timeout /nobreak /t 5代表5秒后打开下一个,根据配置和网络延迟,自己修改。
注意,该值不要设置的太小,否则容易打开漏网页。

1.1.2 方式2:使用Edge浏览器绝对路径(带空格)

@echo off title open web timeout /nobreak /t 5 start "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/" Echo. Echo open web Number is 5 Echo. timeout /nobreak /t 30 

"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"是我Edge浏览器的绝对路径,因为该浏览器默认装在C盘下,绝对路径(Program Files (x86))中带着空格,所以必须加双引号。

1.2 使用谷歌浏览器批量打开网址

1.2.1 使用谷歌浏览器绝对路径打开(不带中文、不带空格)

首先新建一个txt文件,改名为open_chrome.bat,右键 -> 编辑。
将以下命令复制进去:

@echo off title 打开网页 timeout /nobreak /t 10 start C:\Users\anchenliang\AppData\Local\Google\Chrome\Application\chrome.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 10 start C:\Users\anchenliang\AppData\Local\Google\Chrome\Application\chrome.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 10 start C:\Users\anchenliang\AppData\Local\Google\Chrome\Application\chrome.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 10 start C:\Users\anchenliang\AppData\Local\Google\Chrome\Application\chrome.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 10 start C:\Users\anchenliang\AppData\Local\Google\Chrome\Application\chrome.exe "https://blog.csdn.net/AnChenliang_1002/article/details/#comments_" Echo. Echo ##5个页面,请确认数量## Echo. timeout /nobreak /t 10 

保存,退出,双击运行即可。
代码解释:
timeout /nobreak /t 5代表5秒后打开下一个,根据配置和网络延迟,自己修改。
注意,该值不要设置的太小,否则容易打开漏网页。

注意事项:
1、C:\Users\anchenliang\AppData\Local\Google\Chrome\Application\chrome.exe为我安装谷歌浏览器的绝对路径
2、该绝对路径中没有中文没有空格,所以可以直接使用该路径;否则的话,就得加引号了。

1.3 使用ie浏览器批量打开网址

1.3.1 方式1:直接使用浏览器名字iexplore

首先新建一个txt文件,改名为open_ie.bat,右键 -> 编辑。
将以下命令复制进去:

@echo off title open web timeout /nobreak /t 5 start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/" Echo. Echo ##5个页面,请确认数量## Echo. timeout /nobreak /t 30 

保存,退出,双击运行即可。
代码解释:
timeout /nobreak /t 5代表5秒后打开下一个,根据配置和网络延迟,自己修改。
注意,该值不要设置的太小,否则容易打开漏网页。

1.3.2 方式2:使用ie浏览器的绝对路径(带空格)

@echo off title open web timeout /nobreak /t 5 start "" "C:\Program Files\Internet Explorer\iexplore.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start "" "C:\Program Files\Internet Explorer\iexplore.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start "" "C:\Program Files\Internet Explorer\iexplore.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start "" "C:\Program Files\Internet Explorer\iexplore.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start "" "C:\Program Files\Internet Explorer\iexplore.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/" Echo. Echo open web Number is 5 Echo. timeout /nobreak /t 30 

"C:\Program Files\Internet Explorer\iexplore.exe"是我ie浏览器的绝对路径,因为该浏览器默认装在C盘下,绝对路径(Program Files (x86))中带着空格,所以必须加双引号。

1.4 使用火狐浏览器批量打开网址

1.4.1 方式1:直接使用浏览器名字firefox

首先新建一个txt文件,改名为open_fire.bat,右键 -> 编辑。
将以下命令复制进去:
方式1:直接使用firefox

@echo off title open web timeout /nobreak /t 5 start firefox "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start firefox "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start firefox "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start firefox "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start firefox "https://blog.csdn.net/AnChenliang_1002/article/details/" Echo. Echo ##5个页面,请确认数量## Echo. timeout /nobreak /t 30 

保存,退出,双击运行即可。
代码解释:
timeout /nobreak /t 5代表5秒后打开下一个,根据配置和网络延迟,自己修改。
注意,该值不要设置的太小,否则容易打开漏网页。

1.4.2 方式2:使用浏览器绝对路径(带中文字符)

chcp 65001 @echo off title open web timeout /nobreak /t 5 start D:\安装的软件\firefox.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start D:\安装的软件\firefox.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start D:\安装的软件\firefox.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start D:\安装的软件\firefox.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start D:\安装的软件\firefox.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" Echo. Echo ##5个页面,请确认数量## Echo. timeout /nobreak /t 30 

1.5 使用搜狗浏览器批量打开网页

1.5.1 使用搜狗浏览器的绝对路径(不带中文、不带空格)

首先新建一个txt文件,改名为open_sougou.bat,右键 -> 编辑。
将以下命令复制进去:

@echo off title open web timeout /nobreak /t 5 start D:\sougou\SogouExplorer\SogouExplorer.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start D:\sougou\SogouExplorer\SogouExplorer.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start D:\sougou\SogouExplorer\SogouExplorer.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start D:\sougou\SogouExplorer\SogouExplorer.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start D:\sougou\SogouExplorer\SogouExplorer.exe "https://blog.csdn.net/AnChenliang_1002/article/details/" Echo. Echo ##5个页面,请确认数量## Echo. timeout /nobreak /t 30 

保存,退出,双击运行即可。
代码解释:
timeout /nobreak /t 5代表5秒后打开下一个,根据配置和网络延迟,自己修改。
注意,该值不要设置的太小,否则容易打开漏网页。

注意事项:
1、D:\sougou\SogouExplorer\SogouExplorer.exe为我安装搜狗浏览器的绝对路径
2、该绝对路径中不能有中文,不能有空格,否则windows回找不到该exe文件。

二、循环批量打开网页、关闭网页

本文以IE浏览器为例,如果需要使用其他浏览器,参考上面的内容,把下面代码中的iexplore改为其他浏览器名字或绝对路径即可。

@echo off title open web :acl echo. echo ## 即将批量打开的网页 ## echo . timeout /nobreak /t 5 start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/" timeout /nobreak /t 5 start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/" echo ## 即将批量关闭已打开的网页,并再次循环打开 ## timeout /nobreak /t 30 taskkill /f /im iexplore.exe goto acl ::pause exit 

代码解释:
timeout /nobreak /t 5代表5秒后打开下一个,根据配置和网络延迟,自己修改。
注意,该值不要设置的太小,否则容易打开漏网页
taskkill /f /im iexplore.exe代表结束批量关闭ie浏览器,当然,ie中打开的网页也被批量关闭了。

今天的文章
网页自动执行脚本_网页自动执行脚本分享到此就结束了,感谢您的阅读。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/80967.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注