亚马逊上市数据导入 [英] Amazon Listing Data Import

本文介绍了亚马逊上市数据导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将产品标题和评论评级从列表导入到Google Spreadsheet.我已经尝试过使用Xpath查询来实现ImportXML功能,但这是行不通的.因此,我尝试了如下所述的代码,并且有效.我已经能够获取列表数据,但有时它会给我一个错误,而不是显示数据.

I am trying to import the product titles and review ratings from a listing to a Google Spreadsheet. I have tried the ImportXML fuction using Xpath query but that does not work. So, I tried a code as mentioned below and it worked. I have been able to get the listing data but sometimes it gives me an error instead of displaying the data.

错误:

对于 https://www.amazon.co.uk 的请求失败,返回了代码503.已截断服务器响应:有关迁移到...的信息(使用MutantHttpExceptions选项检查完整响应). (第2行).

Request failed for https://www.amazon.co.uk returned code 503. Truncated server response: For information about migrating to ... (use muteHttpExceptions option to examine full response). (line 2).

当我刷新代码或从URL添加/删除https://时,它再次起作用,但是当我刷新工作表时,它会关闭并显示错误.

When I refresh the code or when I add/remove https:// from the url, it works again but when I refresh the sheet, it goes off sometime and displays the error.

问题:

  1. 有什么办法可以消除错误?
  2. 尝试在表格上显示星级"时,它使用Span Data-hook类存储数据,而我无法检索到该数据.还有什么方法可以检索星级?

这是我为获取产品标题和其他数据而创建的功能:

This is the function that I have created to get the product title and other data:


    function productTitle(url) {   
      var content = UrlFetchApp.fetch(url).getContentText();
      var match = content.match(/<span id="productTitle".*>([^<]*)<\/span>/);
      return match && match [1] ? match[1] : 'Title not found';
    }

推荐答案

您正在收到 HTTP状态代码503 ,这意味着您尝试访问的服务正在维护中或处于过载状态.

You are receiving HTTP Status codes of 503, that means the service you are trying to reach is either under maintenance or overloaded.

这是在亚马逊方面.您应该使用Amazon API而不是公共终端节点来处理这些数据.

This is on Amazon's side. You should use the Amazon API instead of the public endpoints for processing this data.

这篇关于亚马逊上市数据导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆