爬蟲系列12.BS4修改文檔樹

修改tag的名稱和屬性 重命名一個tag,改變屬性的值,添加或刪除屬性: soup = BeautifulSoup(‘Extremely bold‘) tag = soup.bweb tag.name = "blockquote" tag['class'] = 'verybold' tag['id'] = 1 tag # <blockquote class="verybold" id="1">Ex
相關文章
相關標籤/搜索