I\'m having trouble parsing HTML elements with \"class\" attribute using Beautifulsoup. The code looks like this
soup = BeautifulSoup(sdata) mydivs = soup.fi
Concerning @Wernight's comment on the top answer about partial matching...
You can partially match:
and with gazpacho: from gazpacho import Soup my_divs = soup.find("div", {"class": "stylelistrow"}, partial=True) Both will be captured and returned as a list of Soup objects. 0 讨论(0) 查看其它17个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
with gazpacho: from gazpacho import Soup my_divs = soup.find("div", {"class": "stylelistrow"}, partial=True) Both will be captured and returned as a list of Soup objects. 0 讨论(0) 查看其它17个回答 发布评论: 提交评论 加载中...
with gazpacho:
from gazpacho import Soup my_divs = soup.find("div", {"class": "stylelistrow"}, partial=True)
Both will be captured and returned as a list of Soup objects.
Soup