バッチファイルを使用してWebサイトからHTMLを取得するために見つかったバッチとJavaの結合スクリプトを使用していますが、URLを使用したときに表示されるとおり、ファイアフォックス。スクリプトが正しくURLを受け取っていない
私はHTMLを引っ張るために使用していたスクリプトは次のとおりです。
@if (@[email protected]) @then
@echo off
rem **** batch zone *********************************************************
setlocal enableextensions disabledelayedexpansion
rem Batch file will delegate all the work to the script engine
if not "%~1"=="" (
cscript //E:JScript "%~dpnx0" %1
)
rem End of batch area. Ensure batch ends execution before reaching
rem javascript zone
exit /b
@end
// **** Javascript zone *****************************************************
// Instantiate the needed component to make url queries
var http = WScript.CreateObject('MSXML2.ServerXMLHTTP.6.0');
// Retrieve the url parameter
var url = WScript.Arguments.Item(0)
// Make the request
http.open("GET", url, false);
http.send();
// If we get a OK from server (status 200), echo data to console
if (http.status === 200) WScript.StdOut.Write(http.responseText);
// All done. Exit
WScript.Quit(0);
私は、スクリプトを養うためにしようとしているURLはhttp://gatherer.wizards.com/Pages/Search/Default.aspx?output=spoiler&method=visual&action=advanced&set=[「アラビアン+ナイト」である]
またはalternativly http://gatherer.wizards.com/Pages/Search/Default.aspx?output=spoiler&method=visual&action=advanced&set=[「アラビアンナイト」 ]
問題私はそれを送り、他のURLのいずれも空間を使用していないように空間/ +と思われるか、+
WA私は、HTMLを引くためのスクリプトを呼び出していますyは:
call callurl.cmd "http://gatherer.wizards.com/Pages/Search/Default.aspx?output=spoiler&method=visual&action=advanced&set=["Arabian+Nights"]"
編集:私だけがMsxml2.XMLHTTP.6.0がMSXML2.ServerXMLHTTPに変更した作られた変更スクリプトがOpen a URL without using a browser from a batch file
からである元のスレッドを発見しました。 6.0では、元のスクリプトがセキュリティのためにサイトを読み込めなかったため、
助けてくれてありがとうございますが、私はまだ出力を得ることができません.HTMLは
@ reddeath68、' geturl.cmd "としてテストhttp://gatherer.wizards.com/Pages/Search/Default.aspx?output=spoiler&method=visual&action = advanced&set = ["Arabian + Nights"] "'と指示された出力が得られます。何を手に入れますか? –
http://pastebin.com/YRdJrsnSは私が得た出力であり、cmd行に追加されたときにそれが "http://gatherer.wizards.com/Pages/Search/Default.aspx?outpu? 何らかの理由で二重の疑問符 –