可以使用字符串替换,将 [email protected] 替换为普通的 @。
示例代码如下:
from bs4 import BeautifulSoup
smiles = 'C[C@@H](Cl)N'
soup = BeautifulSoup(smiles, 'html.parser')
smiles_str = soup.string
# 针对含有 [email protected] 的字符串进行替换
basic_str = smiles_str.replace('[email protected]', '@')