【发布时间】:2020-06-10 02:55:36
【问题描述】:
就像在主题中一样。我的代码看起来像这样。一切正常,但似乎字典在某处被剪掉了。最新的 CVE 来自 2016 年......而不是 2020 年。就像在下面的屏幕上一样。这里有什么问题?我怎样才能获得 2020 CVE? Pycharm 不能加载其余的吗?我尝试在cmd中运行,结果更糟糕,在2014年被砍掉了。我该怎么办?
import pandas as pd
import requests
keyword = 'oracle'
url = 'https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword={}'.format(keyword)
html_data = requests.get(url).text
df = pd.read_html(html_data)
data = df[2].to_dict(orient='records')
for dict in data:
for key in dict:
print(key, dict[key])
这就是它在 cve.mitre.org 上的样子
【问题讨论】:
标签: python pandas python-requests