From 7d0bdb810ddf0d600289a9aea8d5b8584161eb68 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 21 Nov 2021 00:59:38 +0800 Subject: [PATCH] Fix: mapping table null value change to 1st xpath value --- WebCrawler/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WebCrawler/__init__.py b/WebCrawler/__init__.py index 6781686..28149c5 100644 --- a/WebCrawler/__init__.py +++ b/WebCrawler/__init__.py @@ -260,6 +260,8 @@ def get_data_from_json(file_number, oCC): # 从JSON返回元数据 cc_vars = conf.cc_convert_vars().split(",") ccm = conf.cc_convert_mode() for cc in cc_vars: + if json_data[cc] == "" or len(json_data[cc]) == 0: + continue if cc == "actor": try: if ccm == 1: