我只是得到如下輸出但是尋找 CVE-2022-1285
CVE-2022-1285 無
url ='https://nvd.nist.gov/vuln/full-listing/2022/6'
response = requests.get(url)
soup = bs(response.text,'html.parser')
for cve in soup.find_all('span',class_='col-md-2'):
print(cve.text, cve.get('href'))
uj5u.com熱心網友回復:
span您可以獲取a標簽并使用相同的方法,而不是嘗試從元素中提取鏈接。例如:
url ='https://nvd.nist.gov/vuln/full-listing/2022/6'
response = requests.get(url)
soup = bs(response.text,'html.parser')
for cve in soup.find_all('span',class_='col-md-2'):
print(cve.text, cve.a.get('href'))
# link = cve.a.get('href')
# print(link)
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/489023.html
上一篇:如何從一個標簽中抓取單個文本?
