Python 如何提取a的名称<;tr>;用漂亮的汤做标签?
给定以下html文档,如何提取字符串“CLN8”Python 如何提取a的名称<;tr>;用漂亮的汤做标签?,python,html,beautifulsoup,Python,Html,Beautifulsoup,给定以下html文档,如何提取字符串“CLN8” --- 您可以使用BeautifulSoup.find: from bs4 import BeautifulSoup as soup d = soup(html, 'html.parser').find('tr')['data-table-chart-alt-symbol'] 输出: 'CLN8' name是属性吗? 'CLN8'
---
您可以使用BeautifulSoup.find
:
from bs4 import BeautifulSoup as soup
d = soup(html, 'html.parser').find('tr')['data-table-chart-alt-symbol']
输出:
'CLN8'
name
是属性吗?
'CLN8'