爬取内容看不到网络表格内容如何爬取?

http://fund.eastmoney.com/data/fundranking.html#tall;c0;r;s6yzf;pn50;ddesc;qsd20200213;qed20210213;qdii;zq;gg;gzbd;gzfs;bbzt;sfbb

使用BeautifulSoup爬取下的内容中并没有发现列表中内容,什么原因,应该如何爬取?

使用requests只能爬取静态网页,因是js动态加载的所以你得不到想要的结果,要借助selenium 才能获取表格数据。

import pandas as pd

from selenium import webdriver

options=webdriver.ChromeOptions()

options.add_argument('--headless')

driver=webdriver.Chrome(options=options)

driver.get(url)

driver.implicitly_wait(5)

df = pd.read_html(driver.page_source)[3]

print(df)