简体   繁体   中英

how to get data from html with beautiful soup

the output of this code:

productNameText = down_page.find(id='productNameText')
print(productNameText)

gives:

[u'\n', <h1>

            Bold Print Short
        </h1>, u'\n']

How can I gently take only Bold Print Short text from here Thanks

 productNameText = down_page.find(id='productNameText').get_text()
 print productNameText

get_text() Beautiful Soup documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM