I'm trying to get the university names, scores and country names from this website: https://roundranking.com/ranking/world-university-rankings.html#world-2021
I can find the table where the data is by class, but the data which is in the <tbody> part of table is just disappears when I try to find it with Beautiful soup.
Here is the original html code:
<table class="big-table table-sortable uci" style="padding: 0px;">
<thead class="tableFloatingHeaderOriginal">
<tr><th class="td1">Rank</th><th class="td2" style="background-color: rgb(198, 235, 178);">University</th><th class="td3">Score</th><th class="td4">Country</th><th class="td6">Flag</th><th class="td7">League</th></tr>
</thead><thead class="tableFloatingHeader" style="display: none; opacity: 0;">
<tr><th class="td1">Rank</th><th class="td2" style="background-color: rgb(198, 235, 178);">University</th><th class="td3">Score</th><th class="td4">Country</th><th class="td6">Flag</th><th class="td7">League</th></tr>
</thead>
<tbody>
<tr class="az-row-100"><td class="td1">1</td><td class="td2"><a href="/universities/harvard-university.html?sort=O&year=2021&subject=SO">Harvard University</a></td><td class="td3">100.000</td><td class="td4">USA</td><td class="td6"><img src="../images_rur/Flag/Flag_USA.png" alt=""></td><td class="td7">Diamond League</td>
...
</tbody>
</table>
And here is the html what the soup shows:
<table class="big-table table-sortable uci" style="padding: 0px;">
<thead class="tableFloatingHeaderOriginal">
<tr><th class="td1">Rank</th><th class="td2" style="background-color: rgb(198, 235, 178);">University</th><th class="td3">Score</th><th class="td4">Country</th><th class="td6">Flag</th><th class="td7">League</th></tr>
</thead><thead class="tableFloatingHeader" style="display: none; opacity: 0;">
<tr><th class="td1">Rank</th><th class="td2" style="background-color: rgb(198, 235, 178);">University</th><th class="td3">Score</th><th class="td4">Country</th><th class="td6">Flag</th><th class="td7">League</th></tr>
</thead>
</table>
My python code trying to get tha data:
import selenium
from selenium import webdriver
from bs4 import BeautifulSoup
driver = webdriver.Chrome('./chromedriver.exe')
driver.get('https://roundranking.com/ranking/world-university-rankings.html#world-2021')
source = driver.page_source
soup=BeautifulSoup(source)
#soup = BeautifulSoup(source, 'html5lib')
#soup = BeautifulSoup(source, 'html.parser')
#soup = BeautifulSoup(source, 'lxml')
soup.prettify
table=soup.find('table', {'class':'big-table table-sortable uci'})
print(table)
I've tried html5lib, lxml and html.parser but nothing works, when I print out the table it does not contain the body part, which has the data I need.