I want to select a table
tag which has the value of class attribute as:
drug-table data-table table table-condensed table-bordered
So I tried the below code:
for i in soup.select('table[class="drug-table data-table table table-condensed table-bordered"]'):
print(i)
But it fails to work:
ValueError: Unsupported or invalid CSS selector: "table[class="drug-table"
spaces in the class attribute value is the cause for not getting a match. And also, I want to go through two more elements depth like:
soup.select('table[class="drug-table data-table table table-condensed table-bordered"] > tr > th')