在解析代码时,我将一些未知的BaseException变为'search-results'或'referencedby-count',这些查询与其他查询完全相似。
提前致谢。
"require": {
"php": "^7.1.3",
"ext-iconv": "*",
"sensio/framework-extra-bundle": "^5.1",
"symfony/apache-pack": "^1.0",
"symfony/console": "^4.0",
"symfony/expression-language": "^4.0",
"symfony/flex": "^1.0",
"symfony/form": "^4.0",
"symfony/framework-bundle": "^4.0",
"symfony/lts": "^4@dev",
"symfony/maker-bundle": "^1.0",
"symfony/orm-pack": "^1.0",
"symfony/security-bundle": "^4.0",
"symfony/security-csrf": "^4.0",
"symfony/twig-bundle": "^4.0",
"symfony/validator": "^4.0",
"symfony/yaml": "^4.0",
"vich/uploader-bundle": "^1.8"
},
"require-dev": {
"symfony/dotenv": "^4.0",
"symfony/profiler-pack": "^1.0",
"symfony/web-server-bundle": "^4.0"
},
要解析的json数据:
params = get_connection_parameters(title)
r=requests.get(params[0],headers=params[1],timeout=60)
response = r.content
data = json.loads(response)
try:
c_data = data['search-results']['entry'][0]['citedby-count']
value = row.strip("\n")+','+str(c_data)
output.write("\n"+value)
except BaseException as b:
print(b)
}