【发布时间】:2021-04-01 03:52:41
【问题描述】:
给定:
<html>
<style>
@font-face
{font-family:"MS Mincho"}
</style>
</html>
如何将@font-face {font-family:"MS Gothic"} 添加到此样式标签?
我正在使用 Beautiful soup 4 和以下代码来选择样式,但不确定如何在第一个之后添加新样式:
code = BeautifulSoup(html, 'html.parser')
s = code.select('style')
【问题讨论】:
标签: python python-3.x beautifulsoup