Is there anyway of simplifying (merging) this query I am using with beautifulsoup?
table = soup.findAll("tr", {'class' : 'table-tempo-row' })
tablec = soup.findAll("tr", {'class' : 'table-tempo-row-alt' })
for i in (table + tablec):
tableb = i.findAll("td")
thanks.
You can pass in a list:
and BS will match
trelements with either class.For more complex cases, you can pass in a regular expression, or a function (takes the element and returns a boolean).