dp爬同花顺
from DrissionPage import ChromiumPage dp = ChromiumPage() dp.get('https://data.10jqka.com.cn/rank/cxg/') for i in range(1, 11): trs = dp.eles('xpath://*[@id="J-ajax-main"]/table/tbody/tr') for tr in trs: print(tr.text) next_page = dp.ele('下一页') if next_page: next_page.click() dp.wait.load_start()