New to web scraping and selenium/beautifulsoup in general. I’ve been trying to scrape data from this website but beautifulsoup can’t seem to find the text that I want. I just want the date of the first incident that shows up so I used inspect element to find the text is in a vaadin-grid-cell-content tag with slot=”vaadin-grid-cell-content-10″
I tried commands like driver.find_element using xpath and .find with beautifulsoup but can’t seem to find the element. I’m currently using a driver to access the website.
driver.get("https://data.ntsb.gov/carol-main-public/query-builder?month=6&year=2024")
soup = BeautifulSoup(driver.page_source, 'html.parser')
element = soup.find('vaadin-grid-cell-content', {'slot': 'vaadin-grid-cell-content-10'})
date_text = element.text.strip()
print(date_text)
driver.quit()
Kris C is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.