def GetDescription(self, Soup):
descriptionList = []
description = str(Soup.find('div', class='productDescriptionSource').findAll('p'))
print description
我因class
而收到错误。我需要逃脱角色吗?怎么做?谢谢!
答案 0 :(得分:2)
您需要将代码编辑为:
Soup.findAll("div",{"class":"productDescriptionSource"})
答案 1 :(得分:0)
自:
http://www.crummy.com/software/BeautifulSoup/documentation.html#Searching%20by%20CSS%20class
soup.find("b", { "class" : "lime" })