我从html中删除了一些数据并希望将其保存在excel中。如何转换单独存储的字符串和行中的数据?
results = soup.find_all("li", {"class": "lvlg"})
for result in results:
result1 = result.get_text().strip()
result1_new = result1.replace('000', '1')
#print([result1_new])
list_lvlg.append(result1_new)
workbook = xlsxwriter.Workbook('demo.xlsx')
worksheet = workbook.add_worksheet()
#convertet string
workbook.close()