├── spider ├── __init__.py ├── good.py ├── barcode_spider.py └── code.py ├── runtime.txt ├── requirements.txt ├── README.md ├── cloud.py ├── app.py ├── wsgi.py └── templates └── index.html /spider/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.5 -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | beautifulsoup4==4.5.3 2 | Flask==0.12 3 | requests==2.13.0 4 | gevent>=1.0.2,<2.0.0 5 | gevent-websocket>=0.9.5,<1.0.0 6 | leancloud-sdk>=1.0.9,<=2.0.0 7 | Werkzeug>=0.11.11,<1.0.0 8 | Flask-Sockets>=0.1,<1.0 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 商品条码查询 2 | 目前商品条码查询基本都是收费的,所以基于[中国商品信息服务平台](http://www.gds.org.cn/)开发了此API接口供道友使用。 3 | 4 | ### 安装&运行: 5 | > 环境: `macOS 10.12 + Python 3.6 + request 2.13 + Flask 0.12` 6 | 7 | 1. `pip install -r requirements.txt` 8 | 2. `python app.py` 9 | 3. 进入 http://localhost:5000 即可测试API 10 | 11 | 12 | -- 13 | 本项目部署在[leancloud](http://leancloud.cn),地址为 14 | [tenlee.leanapp.cn](http://tenlee.leanapp.cn/) -------------------------------------------------------------------------------- /cloud.py: -------------------------------------------------------------------------------- 1 | #!/bin/env python3 2 | # coding = utf-8 3 | 4 | from leancloud import Engine 5 | from leancloud import LeanEngineError 6 | 7 | from app import app 8 | 9 | 10 | engine = Engine(app) 11 | 12 | 13 | @engine.define 14 | def hello(**params): 15 | if 'name' in params: 16 | return 'Hello, {}!'.format(params['name']) 17 | else: 18 | return 'Hello, LeanCloud!' 19 | 20 | 21 | @engine.before_save('Todo') 22 | def before_todo_save(todo): 23 | content = todo.get('content') 24 | if not content: 25 | raise LeanEngineError('内容不能为空') 26 | if len(content) >= 240: 27 | todo.set('content', content[:240] + ' ...') -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | from flask import Flask, jsonify, render_template 4 | import json 5 | from spider.barcode_spider import BarCodeSpider 6 | from functools import wraps 7 | from flask import make_response 8 | 9 | 10 | def allow_cross_domain(fun): 11 | @wraps(fun) 12 | def wrapper_fun(*args, **kwargs): 13 | rst = make_response(fun(*args, **kwargs)) 14 | rst.headers['Access-Control-Allow-Origin'] = '*' 15 | rst.headers['Access-Control-Allow-Methods'] = 'PUT,GET,POST,DELETE' 16 | allow_headers = "Referer,Accept,Origin,User-Agent" 17 | rst.headers['Access-Control-Allow-Headers'] = allow_headers 18 | return rst 19 | return wrapper_fun 20 | 21 | 22 | app = Flask(__name__) 23 | app.config['JSON_AS_ASCII'] = False 24 | app.debug = True 25 | 26 | 27 | @app.route('/') 28 | def index(): 29 | return render_template("index.html") 30 | 31 | 32 | @app.route('/api/good/', methods=['GET']) 33 | @allow_cross_domain 34 | def get_good(barcode): 35 | good = BarCodeSpider.get_good(barcode) 36 | return jsonify(good.__dict__) 37 | 38 | 39 | if __name__ == '__main__': 40 | app.run(host='0.0.0.0') 41 | -------------------------------------------------------------------------------- /wsgi.py: -------------------------------------------------------------------------------- 1 | #!/bin/env python3 2 | # coding = utf-8 3 | 4 | from gevent import monkey 5 | monkey.patch_all() 6 | 7 | import os 8 | 9 | import leancloud 10 | 11 | from app import app 12 | from cloud import engine 13 | 14 | APP_ID = os.environ['LEANCLOUD_APP_ID'] 15 | APP_KEY = os.environ['LEANCLOUD_APP_KEY'] 16 | MASTER_KEY = os.environ['LEANCLOUD_APP_MASTER_KEY'] 17 | PORT = int(os.environ['LEANCLOUD_APP_PORT']) 18 | 19 | leancloud.init(APP_ID, app_key=APP_KEY, master_key=MASTER_KEY) 20 | # 如果需要使用 master key 权限访问 LeanCLoud 服务,请将这里设置为 True 21 | leancloud.use_master_key(False) 22 | 23 | application = engine 24 | 25 | 26 | if __name__ == '__main__': 27 | # 只在本地开发环境执行的代码 28 | from gevent.pywsgi import WSGIServer 29 | from geventwebsocket.handler import WebSocketHandler 30 | from werkzeug.serving import run_with_reloader 31 | from werkzeug.debug import DebuggedApplication 32 | 33 | @run_with_reloader 34 | def run(): 35 | global application 36 | app.debug = True 37 | application = DebuggedApplication(application, evalex=True) 38 | server = WSGIServer(('localhost', PORT), application, handler_class=WebSocketHandler) 39 | server.serve_forever() 40 | 41 | run() -------------------------------------------------------------------------------- /spider/good.py: -------------------------------------------------------------------------------- 1 | #!/bin/env python3 2 | # coding = utf-8 3 | 4 | __all__ = ['Good'] 5 | 6 | 7 | class Good: 8 | ''' 9 | 商品类 10 | "barcode": "06917878036526", 11 | "name": "雀巢咖啡臻享白咖啡", 12 | "ename": "NESCAFE White Coffee", 13 | "unspsc": "50201708 (食品、饮料和烟草>>饮料>>咖啡和茶>>咖啡饮料)", 14 | "brand": "NESCAFE", 15 | "type": "29g", 16 | "width": "70毫米", 17 | "height": "160毫米", 18 | "depth": "55毫米", 19 | "origincountry": "中国", 20 | "originplace": "", 21 | "assemblycountry": "中国", 22 | "barcodetype": "", 23 | "catena": ",", 24 | "isbasicunit": "0", 25 | "packagetype": "", 26 | "grossweight": "", 27 | "netcontent": "5条", 28 | "netweight": "145克", 29 | "description": "", 30 | "keyword": "雀巢咖啡臻享白咖啡", 31 | "pic": "", 32 | "price": "", 33 | "licensenum": "QS3117 0601 0440", 34 | "healthpermitnum": "" 35 | ''' 36 | barcode = None 37 | name = None 38 | ename = None 39 | unspsc = None 40 | brand = None 41 | type = None 42 | width = None 43 | height = None 44 | depth = None 45 | origincountry = None 46 | originplace = None 47 | assemblycountry = None 48 | barcodetype = None 49 | catena = None 50 | isbasicunit = None 51 | packagetype = None 52 | grossweight = None 53 | netcontent = None 54 | netweight = None 55 | description = None 56 | keyword = None 57 | pic = None 58 | price = None 59 | licensenum = None 60 | healthpermitnum = None 61 | -------------------------------------------------------------------------------- /spider/barcode_spider.py: -------------------------------------------------------------------------------- 1 | #!/bin/env python3 2 | # coding = utf-8 3 | 4 | 5 | import requests 6 | import logging 7 | import random 8 | import re 9 | 10 | from .code import good_detail_code 11 | from .good import Good 12 | 13 | logging.basicConfig(level=logging.INFO) 14 | 15 | 16 | class BarCodeSpider: 17 | logger = logging.getLogger(__name__) 18 | ''' 19 | 条形码爬虫类 20 | ''' 21 | user_agent = [ 22 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) ' 23 | 'Chrome/56.0.2924.87 Safari/537.36', 24 | 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6', 25 | 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/535.11 (KHTML, like Gecko)' 26 | 'Chrome/17.0.963.12 Safari/535.11', 27 | 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)'] 28 | 29 | base_url = 'http://search.anccnet.com/searchResult2.aspx' 30 | 31 | @classmethod 32 | def get_html_by_barcode(cls, barcode): 33 | payload = {'keyword': barcode} 34 | headers = {'user-agent': cls.user_agent[random.randint(0, 3)]} 35 | search_page = requests.get( 36 | cls.base_url, params=payload, headers=headers) 37 | 38 | pattern = re.compile( 39 | r'([\s\S]*?)
' + 40 | barcode + 41 | '
([\s\S]*?)') 42 | m = pattern.match(search_page.text) 43 | if None == m: 44 | return None 45 | 46 | good_detail_url = m.group(2) 47 | cls.logger.info( 48 | "barcode {} url is {}".format( 49 | barcode, good_detail_url)) 50 | 51 | good_detail_page = requests.get(good_detail_url, headers=headers) 52 | 53 | if (good_detail_page.status_code == 200): 54 | return good_detail_page.text 55 | else: 56 | cls.logger.error( 57 | "error, status code is {}, content is {}".format( 58 | good_detail_page.status_code, 59 | good_detail_page.text)) 60 | return None 61 | 62 | @classmethod 63 | def get_good(cls, barcode): 64 | good = Good() 65 | good.barcode = barcode 66 | 67 | html = cls.get_html_by_barcode(barcode) 68 | if html is None: 69 | return good 70 | for key in good_detail_code: 71 | values = good_detail_code[key] 72 | 73 | # 字符串 74 | if isinstance(values, str): 75 | pattern = re.compile( 76 | r"([\s\S]*?)SetValue\('" + values + "','(.*)'\)([\s\S]*?)") 77 | m = pattern.match(html) 78 | if m is not None: 79 | result = m.group(2) 80 | result = result.replace(' ', ' ') 81 | setattr(good, key, result) 82 | else: 83 | setattr(good, key, "") 84 | else: # 元组 85 | result = "" 86 | for value in values: 87 | pattern = re.compile( 88 | r"([\s\S]*?)SetValue\('" + value + "','(.*)'\)([\s\S]*?)") 89 | m = pattern.match(html) 90 | if m is not None: 91 | result += m.group(2) 92 | setattr(good, key, result) 93 | 94 | cls.logger.info("result is {}".format(good.__dict__)) 95 | return good 96 | 97 | 98 | def main(): 99 | good = BarCodeSpider.get_good('06917878036526') 100 | print(good.__dict__) 101 | 102 | 103 | if __name__ == '__main__': 104 | main() 105 | -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 首页 12 | 13 | 14 | 15 | 16 | 25 | 26 | 27 | 28 | 29 | 48 | 49 |
50 | 51 |
52 |
53 |
 
54 |
55 |
56 |
57 | 58 |
59 | 60 |
61 |
62 |
63 |
 
64 |
65 |
 
66 |
67 |
>
 68 | {
 69 |   "name":"haha",
 70 |   "age":12
 71 | }
 72 |                 
73 |
74 |
75 |
76 |
77 |
 
78 |
79 |

请求API参数示例

80 |

/api/good/06917878036526

81 |

返回参数

82 | 83 |
84 |
85 | 86 |
87 | 88 |
89 | 90 | 91 | 93 | 94 | 95 | 96 | 97 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /spider/code.py: -------------------------------------------------------------------------------- 1 | #!/bin/env python3 2 | # coding = utf-8 3 | 4 | import requests 5 | from bs4 import BeautifulSoup 6 | 7 | __all__ = ['good_detail_code'] 8 | 9 | 10 | def get_all_attr(): 11 | url = "http://www.anccnet.com/goods.aspx?base_id=F25F56A9F703ED747E0E167C9EA1642400D316346D26AB36181D28494198D235C33030361735CD16" 12 | req = requests.get(url) 13 | content = req.text 14 | table = BeautifulSoup(content, "html.parser") 15 | for row in table.findAll("tr"): 16 | cells = row.findAll("td") 17 | name = cells[0].text 18 | spans = cells[1].findAll("span") 19 | 20 | if len(spans) == 1: 21 | print("'': ('" + spans[0]['id'] + "'), # " + name) 22 | else: 23 | ids = "(" 24 | for span in spans: 25 | ids += "'" + span['id'] + "'," 26 | 27 | print("'': " + ids.strip(',') + "), #" + name) 28 | 29 | 30 | good_detail_code = { 31 | 'name': ('Att_Sys_zh-cn_141_G'), # 产品名称 32 | 'ename': ('Att_Sys_en-us_141_G'), # 产品名称(英文) 33 | 'unspsc': ('Att_Sys_zh-cn_22_G'), # UNSPSC分类 34 | 'brand': ('Att_Sys_zh-cn_304_G'), # 品牌名称 35 | 'type': ('Att_Sys_zh-cn_332_G'), # 规格型号 36 | 'width': ('Att_Sys_zh-cn_101_G', 'Att_Sys_zh-cn_104_G'), # 宽度 37 | 'height': ('Att_Sys_zh-cn_106_G', 'Att_Sys_zh-cn_326_G'), # 高度 38 | 'depth': ('Att_Sys_zh-cn_118_G', 'Att_Sys_zh-cn_331_G'), # 深度 39 | 'origincountry': ('Att_Sys_zh-cn_74_G'), # 原产国 40 | 'originplace': ('Att_Sys_zh-cn_405_G'), # 产地 41 | 'assemblycountry': ('Att_Sys_zh-cn_171_G'), # 装配国 42 | 'barcodetype': ('Att_Sys_zh-cn_167_G'), # 条码类型 43 | # '': ('Att_Sys_zh-cn_122_G'), # 产品所处层级 44 | 'isbasicunit': ('Att_Sys_zh-cn_107_G'), # 是否为基本单元 45 | # '': ('Att_Sys_zh-cn_204_G'), # 是否为零售单元 46 | # '': ('Att_Sys_zh-cn_312_G'), # 是否为变量单元 47 | # '': ('Att_Sys_zh-cn_151_G'), # 二级品牌 48 | # '': ('Att_Sys_zh-cn_11_G'), # 关键字 49 | # '': ('Att_Sys_zh-cn_90_L'), # 供货开始日期 50 | # '': ('Att_Sys_zh-cn_51_G'), # 包装材料 51 | 'packagetype': ('Att_Sys_zh-cn_31_G'), # 包装类型 52 | # '': ('Att_Sys_zh-cn_43_G', 'Att_Sys_zh-cn_66_G'), # 包装材料计量 53 | # '': ('Att_Sys_zh-cn_271_G'), # 包装上是否有可退还标记 54 | # '': ('Att_Sys_zh-cn_188_G'), # 包装上是否标明成分 55 | # '': ('Att_Sys_zh-cn_32_G'), # 包装上优惠信息 56 | # '': ('Att_Sys_zh-cn_44_G', 'Att_Sys_zh-cn_242_G'), # 包装上零售价格 57 | # '': ('Att_Sys_zh-cn_68_G'), # 包装上环保标记 58 | # '': ('Att_Sys_zh-cn_111_G'), # 包装上循环再生标记 59 | # '': ('Att_Sys_zh-cn_308_G'), # 包装上民族标记 60 | # '': ('Att_Sys_zh-cn_161_G'), # 包装上不含成份的标记 61 | # '': ('Att_Sys_zh-cn_30_G'), # 包装上的有效期类型 62 | # '': ('Att_Sys_zh-cn_230_G'), # 包装上食物规定和过敏原 63 | # '': ('Att_Sys_zh-cn_53_L', 'Att_Sys_zh-cn_193_L'), # 可退包装押金总计 64 | # '': ('Att_Sys_zh-cn_157_L'), # 可退包装押金代码 65 | # '': ('Att_Sys_zh-cn_38_L'), # 最早可退押金日期 66 | # '': ('Att_Sys_zh-cn_147_L'), # 最迟可退押金日期 67 | # '': ('Att_Sys_zh-cn_322_G'), # 包装使用条款 68 | # '': ('Att_Sys_zh-cn_286_G'), # 钉子孔编号 69 | # '': ('Att_Sys_zh-cn_103_G', 'Att_Sys_zh-cn_328_G'), # 钉子孔水平距离 70 | # '': ('Att_Sys_zh-cn_126_G', 'Att_Sys_zh-cn_245_G'), # 钉子孔垂直距离 71 | # '': ('Att_Sys_zh-cn_33_G', 'Att_Sys_zh-cn_40_G'), # 直径 72 | # '': ('Att_Sys_zh-cn_293_G', 'Att_Sys_zh-cn_310_G'), # 固形物重量 73 | 'grossweight': ('Att_Sys_zh-cn_54_G', 'Att_Sys_zh-cn_84_G'), # 毛重 74 | 'netcontent': ('Att_Sys_zh-cn_148_G', 'Att_Sys_zh-cn_162_G'), # 净含量 75 | 'netweight': ('Att_Sys_zh-cn_10_G', 'Att_Sys_zh-cn_189_G'), # 净重 76 | # '': ('Att_Sys_zh-cn_314_G'), # 包装上是否标明净含量 77 | # '': ('Att_Sys_zh-cn_254_G'), # 计价类型 78 | # '': ('Att_Sys_zh-cn_173_G', 'Att_Sys_zh-cn_277_G'), # 计价量 79 | # '': ('Att_Sys_zh-cn_274_G', 'Att_Sys_zh-cn_281_G'), # 排面宽度 80 | # '': ('Att_Sys_zh-cn_89_G'), # 普通成分 81 | # '': ('Att_Sys_zh-cn_79_G', 'Att_Sys_zh-cn_313_G'), # 普通成分浓度 82 | # '': ('Att_Sys_zh-cn_15_G'), # 成分浓度 83 | # '': ('Att_Sys_zh-cn_18_G'), # 尺寸标准 84 | # '': ('Att_Sys_zh-cn_266_G'), # 尺寸类型 85 | # '': ('Att_Sys_zh-cn_26_G', 'Att_Sys_zh-cn_105_G'), # 尺寸 86 | # '': ('Att_Sys_zh-cn_198_G'), # 尺寸描述 87 | # '': ('Att_Sys_zh-cn_298_G'), # 尺寸分组 88 | # '': ('Att_Sys_zh-cn_81_L', 'Att_Sys_zh-cn_227_L'), # 价单价格 89 | # '': ('Att_Sys_zh-cn_196_G', 'Att_Sys_zh-cn_225_G'), # 建议零售价 90 | # '': ('Att_Sys_zh-cn_5_L', 'Att_Sys_zh-cn_75_L'), # 订单至装运的时间 91 | # '': ('Att_Sys_zh-cn_209_L'), # 订购基数 92 | # '': ('Att_Sys_zh-cn_140_L', 'Att_Sys_zh-cn_142_L'), # 订购尺寸因素 93 | # '': ('Att_Sys_zh-cn_17_L'), # 税种代码 94 | # '': ('Att_Sys_zh-cn_27_L'), # 税种描述 95 | # '': ('Att_Sys_zh-cn_233_L'), # 税率 96 | # '': ('Att_Sys_zh-cn_180_L'), # 税额 97 | # '': ('Att_Sys_zh-cn_156_L'), # 发票名称 98 | 'description': ('Att_Sys_zh-cn_4_G'), # 附加描述 99 | # '': ('Att_Sys_zh-cn_36_G'), # 形态描述 100 | # '': ('Att_Sys_zh-cn_205_G'), # 外部描述链接 101 | 'catena': ('Att_Sys_zh-cn_181_G'), # 产品系列 102 | # '': ('Att_Sys_zh-cn_6_G'), # 产品组代码 103 | # '': ('Att_Sys_zh-cn_52_G'), # 产品组描述 104 | # '': ('Att_Sys_zh-cn_48_G'), # 变体 105 | # '': ('Att_Sys_zh-cn_97_L'), # 供货截止日期 106 | # '': ('Att_Sys_zh-cn_45_G'), # 取消日期 107 | # '': ('Att_Sys_zh-cn_325_G'), # 停产日期 108 | # '': ('Att_Sys_zh-cn_117_L'), # 上市时间 109 | # '': ('Att_Sys_zh-cn_135_L'), # 最早订单日期 110 | # '': ('Att_Sys_zh-cn_163_L'), # 最晚订单日期 111 | # '': ('Att_Sys_zh-cn_1_L'), # 最早发货日期 112 | # '': ('Att_Sys_zh-cn_21_L'), # 最晚发货日期 113 | # '': ('Att_Sys_zh-cn_128_G'), # 目标消费者年龄 114 | # '': ('Att_Sys_zh-cn_210_G'), # 目标消费者性别 115 | # '': ('Att_Sys_zh-cn_127_L'), # 产品的特征或优势 116 | # '': ('Att_Sys_zh-cn_219_L'), # 销售广告词 117 | # '': ('Att_Sys_zh-cn_239_L'), # 特殊产品类别 118 | # '': ('Att_Sys_zh-cn_307_L'), # 季节性供应年份 119 | # '': ('Att_Sys_zh-cn_185_L'), # 可供应季节 120 | # '': ('Att_Sys_zh-cn_16_L'), # 季节名称 121 | # '': ('Att_Sys_zh-cn_65_L'), # 季节性供应结束日期 122 | # '': ('Att_Sys_zh-cn_83_L'), # 同币种优惠券代码 123 | # '': ('Att_Sys_zh-cn_42_L'), # 促销活动名称 124 | # '': ('Att_Sys_zh-cn_72_L'), # 促销活动开始日期 125 | # '': ('Att_Sys_zh-cn_296_L'), # 促销活动截止日期 126 | # '': ('Att_Sys_zh-cn_13_G'), # 危险品规则 127 | # '': ('Att_Sys_zh-cn_164_G'), # 危险品运输名称 128 | # '': ('Att_Sys_zh-cn_24_G'), # 危险品专业名称 129 | # '': ('Att_Sys_zh-cn_265_G'), # 危险品分类 130 | # '': ('Att_Sys_zh-cn_136_G'), # 危险品极限数量 131 | # '': ('Att_Sys_zh-cn_94_G'), # 危险品代码 132 | # '': ('Att_Sys_zh-cn_297_G'), # 危险品包装级别 133 | # '': ('Att_Sys_zh-cn_23_G'), # 联合国危险品代码 134 | # '': ('Att_Sys_zh-cn_252_G'), # 原料成分代码 135 | # '': ('Att_Sys_zh-cn_217_G', 'Att_Sys_zh-cn_226_G'), # 燃点 136 | # '': ('Att_Sys_zh-cn_246_G'), # 内包装数 137 | # '': ('Att_Sys_zh-cn_208_G'), # 内包装中次级贸易项目数量 138 | # '': ('Att_Sys_zh-cn_186_L'), # 完整层数(Hi) 139 | # '': ('Att_Sys_zh-cn_85_L'), # 完整层中的贸易项目数(Ti) 140 | # '': ('Att_Sys_zh-cn_145_L'), # 每托盘层数 141 | # '': ('Att_Sys_zh-cn_264_L'), # 每托盘层贸易项目数 142 | # '': ('Att_Sys_zh-cn_259_L'), # 每托盘贸易项目数 143 | # '': ('Att_Sys_zh-cn_152_G'), # 操作说明 144 | # '': ('Att_Sys_zh-cn_149_G'), # 堆放层数 145 | # '': ('Att_Sys_zh-cn_37_G', 'Att_Sys_zh-cn_201_G'), # 堆放最大承重 146 | # '': ('Att_Sys_zh-cn_159_L'), # 到货后有效期 147 | # '': ('Att_Sys_zh-cn_261_G', 'Att_Sys_zh-cn_317_G'), # 贮藏最高温度 148 | # '': ('Att_Sys_zh-cn_262_G', 'Att_Sys_zh-cn_270_G'), # 贮藏最低温度 149 | # '': ('Att_Sys_zh-cn_100_G', 'Att_Sys_zh-cn_330_G'), # 贮藏最大湿度 150 | # '': ('Att_Sys_zh-cn_28_G', 'Att_Sys_zh-cn_195_G'), # 贮藏最小湿度 151 | # '': ('Att_Sys_zh-cn_29_G', 'Att_Sys_zh-cn_253_G'), # 送达配送中心最高温度 152 | # '': ('Att_Sys_zh-cn_57_G', 'Att_Sys_zh-cn_324_G'), # 送达配送中心最低温度 153 | # '': ('Att_Sys_zh-cn_158_G', 'Att_Sys_zh-cn_257_G'), # 送达市场最高温度 154 | # '': ('Att_Sys_zh-cn_7_G', 'Att_Sys_zh-cn_251_G'), # 送达市场最低温度 155 | # '': ('Att_Sys_zh-cn_222_G'), # 托盘类型 156 | # '': ('Att_Sys_zh-cn_99_G'), # 托盘使用条款 157 | 'licensenum': ('Att_Sys_zh-cn_337_G'), # 生产许可证号 158 | 'healthpermitnum': ('Att_Sys_zh-cn_338_G'), # 卫生许可证号 159 | # '': ('Att_Sys_zh-cn_430_G'), # 产品执行标准代号 160 | # '': ('Att_Sys_zh-cn_339_G'), # 绿色食品证号 161 | # '': ('Att_Sys_zh-cn_340_G'), # 保健食品证号 162 | # '': ('Att_Sys_zh-cn_406_G'), # 特殊用途化妆品批准文号 163 | # '': ('Att_Sys_zh-cn_408_G'), # 进口化妆品批准文号 164 | # '': ('Att_Sys_zh-cn_355_L'), # 其他包装类型 165 | # '': ('Att_Sys_zh-cn_356_L'), # 保质期(天) 166 | # '': ('Att_Sys_zh-cn_362_L'), # 其他包装材料 167 | # '': ('Att_Sys_zh-cn_409_G'), # 产地代码 168 | # '': ('Att_Sys_zh-cn_410_G'), # 税号 169 | # '': ('Att_Sys_zh-cn_411_G'), # 配料 170 | # '': ('Att_Sys_zh-cn_412_G'), # 年份 171 | # '': ('Att_Sys_zh-cn_413_G'), # 质量等级 172 | # '': ('Att_Sys_zh-cn_414_G'), # 啤酒类型 173 | # '': ('Att_Sys_zh-cn_415_G'), # 糖度/总糖量 174 | # '': ('Att_Sys_zh-cn_416_G'), # 进口酒类经营许可证代码 175 | # '': ('Att_Sys_zh-cn_417_G'), # 产品标准名称 176 | # '': ('Att_Sys_zh-cn_418_G'), # 香型 177 | # '': ('Att_Sys_zh-cn_419_G'), # 产品添加剂 178 | # '': ('Att_Sys_zh-cn_420_G'), # 加工方式 179 | # '': ('Att_Sys_zh-cn_421_G'), # 地理标志产品名称 180 | # '': ('Att_Sys_zh-cn_422_G'), # 是否具有防伪标识 181 | # '': ('Att_Sys_zh-cn_424_G'), # QS分类 182 | # '': ('Att_Sys_zh-cn_425_G'), # 产品执行标准名称 183 | # '': ('Att_Sys_zh-cn_426_G'), # 防伪方式描述 184 | # '': ('Att_Sys_zh-cn_427_G'), # 防伪类型 185 | # '': ('Att_Sys_zh-cn_428_G'), # 防伪供应商名称 186 | # '': ('Att_Sys_zh-cn_429_G'), # 防伪供应商组织机构代码 187 | # '': ('Att_Sys_zh-cn_434_G'), # 3C认证 188 | # '': ('Att_Sys_zh-cn_435_G'), # 适用车型 189 | # '': ('Att_Sys_zh-cn_436_G'), # 使用寿命 190 | # '': ('Att_Sys_zh-cn_437_G'), # 主要下游企业信息 191 | # '': ('Att_Sys_zh-cn_95_L'), # 其它产品编码 192 | # '': ('Att_Sys_zh-cn_78_G'), # 商标所有者GLN 193 | # '': ('Att_Sys_zh-cn_329_G'), # 商标所有者名称 194 | # '': ('Att_Sys_zh-cn_155_L'), # 附加分类类别代码 195 | # '': ('Att_Sys_zh-cn_194_L'), # 附加分类类别描述 196 | # '': ('Att_Sys_zh-cn_327_L'), # 附加分类机构名称 197 | # '': ('Att_Sys_zh-cn_386_L'), # 必需配件 198 | # '': ('Att_Sys_zh-cn_382_L'), # 直送消费者 199 | # '': ('Att_Sys_zh-cn_404_G'), # eanucc代码 200 | # '': ('Att_Sys_zh-cn_403_G'), # eanucc类型 201 | # '': ('Att_Sys_zh-cn_383_L'), # 环保标识 202 | # '': ('Att_Sys_zh-cn_357_G'), # 是否被辐照 203 | # '': ('Att_Sys_zh-cn_358_G'), # 是否为转基因 204 | # '': ('Att_Sys_zh-cn_359_G'), # 酒精含量 205 | # '': ('Att_Sys_zh-cn_360_G'), # 干货脂肪含量 206 | # '': ('Att_Sys_zh-cn_361_G'), # 原麦汁浓度 207 | # '': ('Att_Sys_zh-cn_402_G'), # GPC分类类别代码 208 | # '': ('Att_Sys_zh-cn_384_L'), # 危险品分类 209 | # '': ('Att_Sys_zh-cn_398_L'), # 是否有防盗标签 210 | # '': ('Att_Sys_zh-cn_380_L'), # 是否提供特殊订货 211 | # '': ('Att_Sys_zh-cn_374_L'), # 是否可召回 212 | # '': ('Att_Sys_zh-cn_381_L'), # 是否包含木料 213 | # '': ('Att_Sys_zh-cn_199_G'), # 制造商GLN 214 | # '': ('Att_Sys_zh-cn_294_G'), # 制造商名称 215 | # '': ('Att_Sys_zh-cn_134_G'), # 原料成分 216 | # '': ('Att_Sys_zh-cn_215_G'), # 原料百分比 217 | # '': ('Att_Sys_zh-cn_150_G'), # 原料安全数据表号码 218 | # '': ('Att_Sys_zh-cn_377_G'), # 型号 219 | # '': ('Att_Sys_zh-cn_363_L', 'Att_Sys_zh-cn_365_L'), # 嵌套增量 220 | # '': ('Att_Sys_zh-cn_109_G'), # 描述性尺寸 221 | # '': ('Att_Sys_zh-cn_432_G'), # 防伪样张(图片) 222 | # '': ('Att_Sys_zh-cn_433_G'), # 防伪生产许可证 223 | # '': ('Att_Sys_zh-cn_35_L'), # 销售单位 224 | # '': ('Att_Sys_zh-cn_88_L'), # 定购单位 225 | # '': ('Att_Sys_zh-cn_176_G'), # 有机产品标准主管机构 226 | # '': ('Att_Sys_zh-cn_247_G'), # 有机状况 227 | # '': ('Att_Sys_zh-cn_368_G', 'Att_Sys_zh-cn_370_G'), # 净深 228 | # '': ('Att_Sys_zh-cn_371_G', 'Att_Sys_zh-cn_372_G'), # 净高 229 | # '': ('Att_Sys_zh-cn_373_G', 'Att_Sys_zh-cn_399_G'), # 净宽 230 | # '': ('Att_Sys_zh-cn_385_L'), # Point Value 231 | # '': ('Att_Sys_zh-cn_376_L'), # 退货政策 232 | # '': ('Att_Sys_zh-cn_63_L'), # 季节性供应开始日期 233 | # '': ('Att_Sys_zh-cn_389_L'), # 防盗标签提交日期 234 | # '': ('Att_Sys_zh-cn_144_G'), # 防盗标签位置 235 | # '': ('Att_Sys_zh-cn_305_G'), # 防盗标签类型 236 | # '': ('Att_Sys_zh-cn_387_L', 'Att_Sys_zh-cn_388_L'), # 建议货架展示数 237 | # '': ('Att_Sys_zh-cn_390_L'), # 特殊订货生产周期(天) 238 | # '': ('Att_Sys_zh-cn_392_L'), # 特殊订货最小订购数 239 | # '': ('Att_Sys_zh-cn_393_L'), # 特殊订购增量 240 | # '': ('Att_Sys_zh-cn_396_L'), # 是否涉及美国专利 241 | # '': ('Att_Sys_zh-cn_223_L'), # 目标市场细分代码 242 | # '': ('Att_Sys_zh-cn_123_L'), # 税机构代码 243 | # '': ('Att_Sys_zh-cn_70_L'), # 被替代产品的其它产品编码 244 | # '': ('Att_Sys_zh-cn_323_G'), # 被替代产品的GTIN 245 | # '': ('Att_Sys_zh-cn_9_G'), # 颜色代码表管理机构 246 | # '': ('Att_Sys_zh-cn_177_G'), # 颜色代码 247 | # '': ('Att_Sys_zh-cn_182_G'), # 颜色描述 248 | # '': ('Att_Sys_zh-cn_131_L'), # 专卖权结束日期/时间 249 | # '': ('Att_Sys_zh-cn_203_L'), # 最小订购数量开始日期 250 | # '': ('Att_Sys_zh-cn_207_L'), # 最小订购数量截止日期 251 | # '': ('Att_Sys_zh-cn_237_L'), # 最大订购数量开始日期 252 | # '': ('Att_Sys_zh-cn_279_L'), # 最大订购数量截止日期 253 | # '': ('Att_Sys_zh-cn_132_G'), # 简短描述 254 | # '': ('Att_Sys_zh-cn_61_G'), # 外观描述 255 | # '': ('Att_Sys_zh-cn_55_L'), # 进口分类代码 256 | # '': ('Att_Sys_zh-cn_212_L'), # 进口分类类型 257 | # '': ('Att_Sys_zh-cn_3_G'), # 未售出是否可退回 258 | # '': ('Att_Sys_zh-cn_47_G'), # 是否标明可再生利用 259 | # '': ('Att_Sys_zh-cn_58_G'), # 是否有批号 260 | # '': ('Att_Sys_zh-cn_102_G'), # 织数 261 | # '': ('Att_Sys_zh-cn_224_G', 'Att_Sys_zh-cn_289_G'), # 原料重量 262 | # '': ('Att_Sys_zh-cn_14_L'), # 最少订购数量 263 | # '': ('Att_Sys_zh-cn_46_L', 'Att_Sys_zh-cn_218_L'), # 订货至交货的时间 264 | # '': ('Att_Sys_zh-cn_124_L'), # 可否再次订购 265 | # '': ('Att_Sys_zh-cn_153_L'), # 最早送达日期/时间 266 | # '': ('Att_Sys_zh-cn_154_L'), # 协议最大购买量 267 | # '': ('Att_Sys_zh-cn_229_L'), # 是否依据数量定价 268 | # '': ('Att_Sys_zh-cn_256_L'), # 最大订购数量 269 | # '': ('Att_Sys_zh-cn_272_L'), # 协议最小购买量 270 | # '': ('Att_Sys_zh-cn_166_G'), # 尺寸代码表机构 271 | # '': ('Att_Sys_zh-cn_316_G'), # 尺寸代码 272 | # '': ('Att_Sys_zh-cn_56_G'), # 变量贸易项目类型 273 | # '': ('Att_Sys_zh-cn_82_L'), # 是否为物流单元 274 | # '': ('Att_Sys_zh-cn_87_L'), # 是否为可订购单元 275 | # '': ('Att_Sys_zh-cn_139_L'), # 是否为发票单元 276 | # '': ('Att_Sys_zh-cn_258_L'), # 定价依据 277 | # '': ('Att_Sys_zh-cn_92_G'), # 遵从法规 278 | # '': ('Att_Sys_zh-cn_394_L', 'Att_Sys_zh-cn_395_L'), # 整车数量 279 | # '': ('Att_Sys_zh-cn_366_L', 'Att_Sys_zh-cn_367_L'), # 组件数目 280 | # '': ('Att_Sys_zh-cn_379_G'), # 保修说明的URL 281 | # '': ('Att_Sys_zh-cn_378_G'), # 保修说明 282 | # '': ('Att_Sys_zh-cn_431_G'), # 营业执照 283 | } 284 | 285 | if __name__ == '__main__': 286 | get_all_attr(); 287 | --------------------------------------------------------------------------------