使用 Curl in Batch 来控制 HTML 元素



我目前正在尝试通过简单地使用批处理文件来找出一种在网站上按下按钮的方法。

具体来说,我想"控制"收音机播放器的播放按钮(最好的情况:不显示页面(。

我相信这是播放按钮的 HTML 元素:

<svg class="icon icon-play-2016" id="gl-pl-play">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-play-2016" id="gl-pl-play"> </use>
</svg>

我在网上搜索并发现可以以某种方式使用 curl 命令,但我使用它的尝试没有成功:

@echo on
start https://www.radio.de/s/antennemuenster
curl -s -w "%%{http://www.w3.org/1999/xlink}" https://www.radio.de/s/antennemuenster
exit

在我看来,您应该通过另一个工具提取流,我可以使用IDM : Internet Downloader Manager

您可以使用使用 vbscript 播放流的批处理文件编写它:

@echo off
Title Welcome to the world of the music
Mode 50,3 & color 9E
echo(
echo        Welcome to the world of the music
Rem Just change this variable MusciPath
Set MusicPath=http://mms.hoerradar.de/am128k
rem http://swr-edge-20bc.fra-lg.cdn.addradio.net/swr/swr1/bw/mp3/128/stream.mp3
Call :Play "%MusicPath%"
Pause>nul & Exit
::---------------------------------------------------------------
:Play
Set "VBS_MUSIC=%temp%SWR1_Radio.vbs"
(
echo Play "%~1"
echo Sub Play(MusicPath^)
echo    Dim Sound
echo    Set Sound = CreateObject("WMPlayer.OCX"^)
echo    Sound.URL = MusicPath
echo    Sound.settings.volume = 100
echo    Sound.Controls.play
echo    While Sound.playState ^<^> 1
echo        WScript.Sleep 100
echo    Wend
echo End Sub
)>"%VBS_MUSIC%"
Cscript //NoLogo "%VBS_MUSIC%"
exit /b
::---------------------------------------------------------------

最新更新