全部vbs脚本是吗,试试
test.bat 电脑win10以上- #&cls&cd /d "%~dp0" & @powershell -c "Get-Content '%~0' | Out-String | Invoke-Expression" &pause&exit
- cls
- function Parse-Content($whr,$url,$title,$p,$tab){
- $whr.Open('GET',$url,$false)
- $whr.Send()
- $s = $whr.ResponseText
- $whr.Abort()
- $a_list = $null
- if($s -match '(?s)(?<=<code class="classmyad">).*?(?=</code>)'){
- $a_list = $Matches[0] -split '\n' | Where-Object { $_ -match '^<a' }
- }
- Write-Host ($tab + $title)
- if($a_list -ne $null){
- $a_list | foreach {
- $arr = $_ -split '>|<|"'
- Parse-Content -whr $whr -url (($url -replace '/[^/]*$','/') + $arr[2]) -title $arr[4] -p ($p + '\' + $arr[4]) -tab ($tab + ' ')
- }
- } else {
- $vbs = '.\' + $p + '.vbs'
- $dic = [System.IO.Path]::GetDirectoryName($vbs)
- [void][System.IO.Directory]::CreateDirectory($dic)
- Write-Host ('{0}保存文件:{1}' -f $tab,$vbs)
- $Matches[0] -replace '(?s)<input.*?<font>','' -replace '<br>',"`r`n" -replace '(?s)<.*?>','' -replace ' ',' ' | Out-File $vbs
- }
- }
-
- $whr = New-Object -ComObject 'WinHttp.WinHttpRequest.5.1'
- Parse-Content -whr $whr -url 'https://www.vbsedit.com/scripts/' -title 'Scripts' -p 'Scripts' -tab ''
复制代码
|