使用 beautifulsoup in python 从列表中获取数据

Get data from list using beautifulsoup in python

我有网页- https://dmesupplyusa.com/mobility/bariatric-rollator-with-8-wheels.html 这里有一个详细信息列表,我想将其提取为 table,即规格类别为 header,规格值作为下一行。我如何在 python 中使用 beautifulsoup 执行此操作?

import requests
import pandas as pd
from bs4 import BeautifulSoup as bs

page = requests.get("https://dmesupplyusa.com/mobility/bariatric-rollator-with-8-wheels.html").content #Read Page source

page = bs(page) # Create Beautifulsoup object
data = page.find_all('strong', string="Product Specifications")[0].find_next('ul').text.strip().split('\n') # Extract requireed information
data = dict([zip(i.split(":")) for i in data])
df = pd.DataFrame(data).T

希望这就是您要找的。