• 淘宝API读取商品属性


    1.下载官网demo(参考第四个demo)

    导入TopSpace.Bll.dll
     
    2.复制以下类
    Client.cs,Config.cs
     
    3.在web.config的<appSettings>下面加入
    <add key="SandBox" value="0"/>
    <add key="AppKey" value="12510432"/>
    <add key="AppSecret" value="..密码不便公布.."/>
     
     
    4.添加代码
     
    TopAPI.AppKey = Config.Appkey;
    TopAPI.AppSecret = Config.Secret;
    TopAPI.RestUrl = Config.ServerURL;
     
    Item item = new Item();//定义返回商品对象
    Parser parser = new Parser();//定义解析XML对象
    ErrorRsp err = new ErrorRsp();//定义错误对象
     
    Dictionary<string, string> param = new Dictionary<string, string>();
    param.Add("fields", "detail_url,num_iid,title,nick,type");
    param.Add("num_iid", "7969802699");//商品字符串ID。iid和num_iid选择一个传入 
    string strXml = TopAPI.Post("taobao.item.get", Client.Session, param);
    ItemResponse rsp = new ItemResponse();//定义输出商品结构对象
     
    parser.XmlToObject2(strXml, "item_get", "item", item, err);
    Response.Write(item.title);

     

  • 相关阅读:
    otto-group-product-classification-challenge(Pytorch处理多分类问题)
    F1值
    win10 安装torch
    win10 安装 scrapy
    头条 街拍
    1029 Median
    欧拉回路
    Pre-Post
    Django 安装for Python3.4
    Python 安装for Windows
  • 原文地址:https://www.cnblogs.com/kenny999/p/2356858.html
Copyright © 2020-2023  润新知