python 2.7 - How to get the item inside dd? -


i want things inside dd only. have code:

import urllib bs4 import beautifulsoup  url = 'http://www.brothersoft.com/windows/mp3_audio/' pagehtml = urllib.urlopen(url).read() soup = beautifulsoup(pagehtml)  in soup.select('div.coleft.cate.mbottom a[href]'):     print "http://www.brothersoft.com"+ a['href'] 

but output give inside class. need item inside dd only. how that?

just put dd inbetween:

for in soup.select('div.coleft.cate.mbottom dd a[href]'):     #                                         ^^     print "http://www.brothersoft.com"+ a['href'] 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -