ex) In html
<tr class='odd'> ~~~~
<tr class='even'> ~~~~
I am studying Crawling using Beautiful soup in python3.
I want to 'odd' class and 'even' class
So, I wrote that
url = 'http:// ~~~~'
src_code = requests.get(url)
plain_txt = src_code.text
soup = BeautifulSoup(plain_txt, 'lxml')
trTag = soup.findAll('tr', class_ = 'odd' | 'even')
But,
trTag = soup.findAll('tr', class_ ='odd' | 'even')
in this line, error.
I want to find odd class and even class at one go.
Is it impossible?
I have to write trTag = soup.findAll('tr',class_='odd') trTag = soup.findAll('tr',class_='even')
separately?
I want to learn.