2016-07-21 8 views
1

次のコードを使用して、このURLでUrlFetchApp.Fetchを使用してHTML要素を取得したかったのです。ただし、特定のURLのみが動作するようです。他のURLは500またはBad requestを返します。GoogleアプリケーションスクリプトでUrlFetchApp.Fetch()からの応答を取得し、Loggerで印刷

function getHTML() 
    { 
     var response = UrlFetchApp.fetch("http://www.theoutlet24.com/th/catalogsearch/\ 
             result/index/?cat=0&limit=all&q=4X4Man"); 
     Logger.log(response); 
    } 

この問題についての助けは相当です。

+0

あなたはアプリケーションスクリプトを使用していますか? –

答えて

1

URLを入力した後にオプションとして{muteHttpExceptions:true}を追加するだけです。

function getHTML() 
    { 
    var response = UrlFetchApp.fetch("http://www.theoutlet24.com/th/catalogsearch/result/index/?cat=0&limit=all&q=4X4Man",{muteHttpExceptions:true}); 
    Logger.log(response); 
    } 
関連する問題