or symbol for select in beautiful soup

Solutions on MaxInterview for or symbol for select in beautiful soup by the best coders in the world

showing results for - "or symbol for select in beautiful soup"
Marco
08 Jan 2019
1from bs4 import BeautifulSoup
2html='''
3<ol class="products-list" id="products">
4    <li class="item odd">
5    </li>
6    <li class="item even">
7    </li>
8    <li class="item last even">
9    </li>
10</ol>
11'''
12
13page_soup=BeautifulSoup(html,'html.parser')
14for item in page_soup.select(".odd,.even"):
15    print(item)