From e8050922f925cf738a018fd29f695d9c6e324ed0 Mon Sep 17 00:00:00 2001 From: bofa1ex Date: Sat, 9 Oct 2021 15:22:21 +0800 Subject: [PATCH] ... --- hq.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hq.py b/hq.py index ee7eff3..ccdc475 100644 --- a/hq.py +++ b/hq.py @@ -31,7 +31,7 @@ def hq(): resp = {} for index, exp in enumerate(args.xpath): - it = re.findall('(\\w+)=?(/.*)', exp, re.M)[0] + it = re.findall('(\\w+)?=?(/.*)', exp, re.M)[0] key = '_{}'.format(index) if len(it[0]) == 0 else it[0] val = it[0] if len(it) == 1 else it[1] items = [ @@ -40,7 +40,7 @@ def hq(): ] resp[key] = items[0] if len(items) == 1 else items - sys.stdout.writelines(json.dumps(resp, ensure_ascii=False)) + sys.stdout.writelines(json.dumps(resp, ensure_ascii=False) + '\n') sys.stdout.flush()