2012-01-13 47 views
-1
def GetDescription(self, Soup): 

descriptionList = [] 

description = str(Soup.find('div', class='productDescriptionSource').findAll('p')) 

print description 

由於class,我得到錯誤。我需要轉義字符嗎?怎麼做?謝謝!python beautifulsoup findall p tags

回答

2

您需要編輯您的代碼:

Soup.findAll("div",{"class":"productDescriptionSource"})