我正在尝试从网站上抓取数据。获取产品信息的请求 url正确显示在浏览器中。但没有得到UrlFetchApp
. 我的代码如下
function myFunction() {
var coles_url = "https://shop.coles.com.au/search/resources/store/20520/productview/bySeoUrlKeyword/mutti-tomato-passata-2349503p?catalogId=12064";
Logger.log(jsonInitColes(coles_url));
}
function jsonInitColes(url){
var options =
{
"method" : "GET",
"followRedirects" : true,
"muteHttpExceptions": true
};
var response = UrlFetchApp.fetch(url,options);
var content = response.getContentText();
return content;
}
但是我得到了以下 HTML 而不是数据 status_code 是 429(请求太多)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="about:blank">
</head>
<body>
<script src="/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/j.js"></script>
<script src="/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/f.js"></script>
<script src="/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/fingerprint/script/kpf.js?url=/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/fingerprint&token=c3436f36-e3c3-a537-25f3-bedc8592f189"></script>
</body>
</html>