qbnk / validoo-api-wrapper
Validoo PHP 包装器,基于 https://validoo.se/wp-content/uploads/2021/10/GS1_REST_TradeItemInformation_v2.0.pdf 中的规范
v0.1.6
2022-08-31 12:04 UTC
Requires
- php: >=7.4
- ext-dom: *
- ext-json: *
- adbario/php-dot-notation: ^2.2
- guzzlehttp/guzzle: ^6.3 | ^7.0
Requires (Dev)
- mockery/mockery: ^1.3
- phpunit/phpunit: ^8.5
README
抓取GS1代码表
代码表可在 https://gs1.se/en/guides/documentation/code-lists/ 获取
这似乎可以抓取任何代码表页面。当您想只抓取瑞典或所有值时(当代码表有“仅限瑞典”列时),请取消注释 "if sweden"。
let codes = {};
jQuery('table.table-striped.responsive').find('td[data-th="Code value"]').map(function() {
const cell = jQuery(this),
name = cell.next(),
sweden = cell.next().next().next();
//if (sweden.find('span').text() === 'X') {
codes[cell.find('span').text().toLowerCase()] = name.find('span').text();
//}
});
JSON.stringify(codes);