Parsing html using BeautifulSoup in Python
问题 I wrote some code to parse html, but the result was not what I wanted: import urllib2 html = urllib2.urlopen('http://dummy').read() from BeautifulSoup import BeautifulSoup soup = BeautifulSoup(html) for definition in soup.findAll('span', {"class":'d'}): definition = definition.renderContents() print "<meaning>", definition for exampleofuse in soup.find('span',{"class":'x'}): print "<exampleofuse>", exampleofuse, "<exampleofuse>" print "<meaning>" Is there any kind of way that when class