I am trying to scrape some rugby statistics from pages that all look like this one (one per player): https://www.unitedrugby.com/clubs/benetton/filippo-alongi
This is just an example one.
First I set up a driver with selenium and then pass the content to BeautifulSoup for html exploration.
url = "https://www.unitedrugby.com/clubs/benetton/filippo-alongi"
driver = webdriver.Chrome( options=chrome_options)
driver.get(url)
soup = driver.page_source
soup = BeautifulSoup(soup, 'html.parser')
driver.quit()
At this point, I want to fetch the following class: player-hero__info-wrap. I do that with find_all(), which can find most things but not all of them.
By clicking on the link I provided, and inspecting the weight value (118KG) you will land very near to this tag in the inspector, so you can see that it exists.
However, when scraping it, I can't see it. I am using selenium because this page seems like it needs to be rendered with javascript before reading it, but I still can't see all classes.
I tried adding the following lines to execute javascript:
driver.execute_script("return document.documentElement.outerHTML;")
or even:
driver.execute_script("return document.getElementsByTagName('html')[0].innerHTML")
But nothing.
Can anybody help me fetch this class?