I am trying to extract table data from this web site
Following is the code--
import requests
from bs4 import BeautifulSoup as bs
page = requests.get('https://www.vitalityservicing.com/serviceapi/Monitoring/QueueDepth?tenantId=1')
soup = bs(page.text, "html.parser")
#None of the following method works
tb = soup.table
#tb = soup.body.table
#tb = soup.find_all('table')
When I try to print tb
its None
So I tried to look at the body
of the downloaded HTML with
print(soup.body.prettify())
I dont see the table
elements or it's child elements . Only <body>
and <script>
elements are present:
But when I inspect the page in chrome I see all the elements:
I don't understand why the table
element is not being downloaded with requests.get
while its there when I load the page on chrome