Board logo

标题: [网络连接] 如何利用批处理批量打开网页,并访问 [打印本页]

作者: Rasm    时间: 2023-5-25 12:39     标题: 如何利用批处理批量打开网页,并访问

本帖最后由 Rasm 于 2023-5-25 13:33 编辑
  1. start chrome.exe https://www.dismall.com//member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=retergis123&password=retergis123&quickforward=yes&handlekey=ls
复制代码
这是discuz一键登录的地址,我想通过批处理来实现一键批量登陆,但是我通过以上代码保存批处理后执行访问,
浏览器只打开了以下地址,  https://www.dismall.com//member.php?mod=logging

后面的地址没有完整的去访问。导致一键登录无法正常实现。

请问下,要该如何写才能利用一键登录的地址,实现多账号一键登录。



以下是一键登录的地址,任意一条,手工放到浏览器里就能直接登陆了。但是通过批处理的话,要怎么写代码能实现呢
  1. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=123456vshjs&password=123456Vshjs@&quickforward=yes&handlekey=ls
  2. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=12369938867zzy&password=12369938867Zzy@&quickforward=yes&handlekey=ls
  3. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=45画江湖&password=45画江湖@&quickforward=yes&handlekey=ls
  4. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=5797porn&password=5797Porn@&quickforward=yes&handlekey=ls
  5. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=5941911a&password=5941911A@&quickforward=yes&handlekey=ls
  6. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=5eyey7e&password=5Eyey7E@&quickforward=yes&handlekey=ls
  7. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=79ytr&password=79Ytr@&quickforward=yes&handlekey=ls
  8. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=98t98t98t98t&password=98T98T98T98T@&quickforward=yes&handlekey=ls
  9. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=AA125732&password=Aa125732@&quickforward=yes&handlekey=ls
  10. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=ASHENG123&password=Asheng123@&quickforward=yes&handlekey=ls
  11. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=Arthurl&password=Arthurl@&quickforward=yes&handlekey=ls
复制代码

作者: 77七    时间: 2023-5-25 13:56

  1. @echo off
  2. for /f "delims=" %%a in ('type "%~0" ^|findstr /bc:"https"') do (
  3. start chrome.exe %%a
  4. timeout 1 >nul
  5. )
  6. exit
  7. rem 链接写在下方
  8. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=123456vshjs&password=123456Vshjs@&quickforward=yes&handlekey=ls
  9. https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=12369938867zzy&password=12369938867Zzy@&quickforward=yes&handlekey=ls
复制代码

作者: Rasm    时间: 2023-5-25 15:53

回复 2# 77七


你好,他说是想吧用户名放1.txt,密码放2.txt,要如何修改下?
作者: jyswjjgdwtdtj    时间: 2023-5-25 18:11

这样多少不太稳定 不如用vbs操作ie
最好直接在浏览器里window.open或者iframe,比啥都强
现在的浏览器也有读文件,选文件的功能
作者: Rasm    时间: 2023-5-25 18:45

回复 4# jyswjjgdwtdtj


    是啊,如果像我目前这种方式,要是登录50个的话,浏览器要卡死
目前的浏览器还是谷歌稳定点。
未请教,如果利用vbs,如何实现?
作者: jyswjjgdwtdtj    时间: 2023-5-25 18:57

回复 5# Rasm


    set ie=createobject("internetexplorer.application")
ie.navigate "https://www.dismall.com//member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username=retergis123&password=retergis123&quickforward=yes&handlekey=ls"
ie.visible=true
作者: 77七    时间: 2023-5-25 20:52

回复 3# Rasm
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. set "part1=https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username="
  4. set "part2=&password="
  5. set "part3=@&quickforward=yes&handlekey=ls"
  6. for /f "delims=" %%a in ('type "1.txt"') do (
  7. set /a n+=1
  8. set "#!n!=%%a"
  9. )
  10. for /f "delims=" %%a in ('type "2.txt"') do (
  11. set /a m+=1
  12. for %%b in (!m!) do (
  13. start chrome.exe "!part1!!#%%b!!part2!%%a!part3!"
  14. timeout 1 >nul
  15. )
  16. )
  17. exit
复制代码

作者: Rasm    时间: 2023-5-31 11:35

回复 7# 77七

依次批量打开URL并自动关闭的bat命令,也能实现吗
  有时候打开太多,怕浏览器卡死
    我想每 30秒关闭一次浏览器上的所有标签, 这样就不会让浏览器卡死了,直至吧 文本里的 地址全部打开一遍结束
作者: 77七    时间: 2023-5-31 13:43

回复 8# Rasm


  
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. set "part1=https://www.dismall.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&fastloginfield=username&username="
  4. set "part2=&password="
  5. set "part3=@&quickforward=yes&handlekey=ls"
  6. for /f "delims=" %%a in ('type "1.txt"') do (
  7. set /a n+=1
  8. set "#!n!=%%a"
  9. )
  10. for /f "delims=" %%a in ('type "2.txt"') do (
  11. set /a m+=1,k=m%%30
  12. for %%b in (!m!) do (
  13. start chrome.exe "!part1!!#%%b!!part2!%%a!part3!"
  14. timeout 1 >nul
  15. )
  16. if !k! equ 0 (
  17. taskkill /f /im chrome.exe
  18. timeout 2 >nul
  19. )
  20. )
  21. exit
复制代码
只会强制关闭谷歌浏览器
作者: jyswjjgdwtdtj    时间: 2023-5-31 18:57

  1. With CreateObject("internetexplorer.application")
  2.   .visible = True
  3.   un = CreateObject("scripting.filesystemobject").opentextfile("1.txt",1).readall
  4.   pw = CreateObject("scripting.filesystemobject").opentextfile("2.txt",1).readall
  5.   For i = 0 To UBound(un)
  6.       .navigate mdste(un,pw)
  7.       Do Until .readystate = 4
  8.         WScript.sleep 100
  9.       Loop
  10.   Next
  11. End With
  12. Function mbstr(username,password)
  13.   mbstr = "https://www.dismall.com/member.php?" & _
  14.   "mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&" & _
  15.   "fastloginfield=username&username=" & username & "&password=" & password & "&quickforward=yes&handlekey=ls"
  16. End Function
复制代码
还可以多开几个




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