[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
http://www.bathome.net/viewthread.php?tid=62770&highlight=%BB%F9%D3%DA
参考这个操作浏览器,先下好对应的selenium库文件和edge驱动程序
  1. <# :
  2. cls&@echo off
  3. set "url=https://market.m.taobao.com/app/eleme_nr_bfe_retail/eb_download/index.html"
  4. set "de=C:\A\B"
  5. rem 以上设置网址和下载目录
  6. cd /d "%~dp0"
  7. powershell -NoProfile -ExecutionPolicy bypass "Invoke-Command -ScriptBlock ([ScriptBlock]::Create([IO.File]::ReadAllText('%~f0',[Text.Encoding]::GetEncoding('GB2312')))) -Args '%url%','%de%'
  8. exit
  9. #>
  10. using namespace 'OpenQA.Selenium'
  11. Get-ChildItem '*.dll' | % {[void][System.Reflection.Assembly]::LoadFile($_.FullName)}
  12. $edge = [Edge.EdgeDriver]::new()
  13. $edge.Url = $args[0]
  14. sleep 1
  15. $href = $edge.FindElement([by]::classname('gray-btn')).GetAttribute('href')
  16. Write-Host $href
  17. $edge.Close()
  18. $edge.Dispose()
  19. Start-BitsTransfer -Source $href -Destination $args[1]
复制代码

TOP

回复 5# idwma


    downloadUrl似乎是在Content里的
  1. powershell -c "$downloadUrl = iwr 'https://nr.ele.me/eleme_nr_bfe_retail/eb_download/config/download' | ConvertFrom-Json | Select-Object -ExpandProperty downloadUrl;iwr $downloadUrl -outfile ($downloadUrl -replace '.+/')"
复制代码
1

评分人数

TOP

返回列表