I am trying to fetch a specific table from a webpage using BeautifulSoup4 and Selenium the table is present there but it is not fetching using this code. I tried this
from bs4 import BeautifulSoup
from selenium import webdriver
import time
driver = webdriver.Chrome()
url = 'https://de.sharkscope.com/#Find-Tournament/networks/PokerStars/tournaments/2412466083'
driver.get(url)
res = driver.execute_script("return document.documentElement.outerHTML")
time.sleep(5)
driver.quit()
soup = BeautifulSoup(res, 'lxml')
targetTable = soup.findAll('table', {'id': 'tournamentgrid-1538318460041'})
print(targetTable)
screenshot table With ID and the Result DisplayResult
Platform and tools
- Microsoft Windows 10 x64
- Using Chromium Webdriver ( installed version 32bit)
Edited. I already Tried
table = driver.get_element_by_id('tournamentgrid-1538318460041')
&
table = driver.get_element_by_xpath('//*[@id="tournamentgrid-1538398792982"]')