-1
desc = re.compile('<ul class="descShort bullet">(.*)</ul>', re.DOTALL)
findDesc = re.findall(desc, link_source)
for i in findDesc:
print i
'''
<ul class="descShort bullet">
Sleek and distinctive, these eye-catching ornaments will be the star of your holiday decor. These unique glass icicle ornaments are individually handcrafted by artisans in India.
</ul>
'''
我試圖提取ul類標記和/ ul之間的描述。我正在尋找使用REGEX的soltuion,以及beautifulsoup。python re.compile美麗的湯
我想至少你嘗試* *使用HTML解析器......但不幸的你還在使用正則表達式來解析HTML。 –
我是這個網站的新手,我該如何去做呢?謝謝! – phales15
查看[您的問題列表](http://stackoverflow.com/users/1018129/aaron-phalen?tab=questions);如果對他們中的任何人都有很好的答案,請點擊旁邊的勾號的輪廓。 – egor83