How can I solve the problem of not being able to read the data when I crawl the web with Beautiful Soup and selenium?

Asked 2 years ago, Updated 2 years ago, 141 views

from bs4 import BeautifulSoup
from selenium import webdriver

driver = webdriver.Firefox()
driver.get("http://ntry.com/#/stats/ladder/date.php?date=2014-01-04")

html = driver.page_source
soup = BeautifulSoup(html, "html.parser")

prodList = soup.find_all("td", {"class": "round_cell"})
print(prodList)

The result value at run time is [ ] Come out.

beautifulsoup selenium selenium-webdrive python3

2022-09-21 19:30

1 Answers

BeHow can I solve the problem of not being able to read the data when I crawl the web with automatic soup?I think you followed the answer in . If you follow the code you posted, reading HTML will work well.

But if you look at the source code, there is no tag called td, and there is no element with a class called round_cell. Please state what you are looking for.


2022-09-21 19:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.