Answers for "or symbol for select in beautiful soup"

0

or symbol for select in beautiful soup

from bs4 import BeautifulSoup
html='''
<ol class="products-list" id="products">
    <li class="item odd">
    </li>
    <li class="item even">
    </li>
    <li class="item last even">
    </li>
</ol>
'''

page_soup=BeautifulSoup(html,'html.parser')
for item in page_soup.select(".odd,.even"):
    print(item)
Posted by: Guest on September-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language