![]() |
1
janda 71 天前
xpath
|
![]() |
2
colatea 71 天前
我用 xpath,大同小异,取到 div 内容为 2022.04.18 以后,向上找父节点,再向下找 table
html.xpath("\\div[text()='2022.04.18']/../table/tbody") |
![]() |
3
Ritter 71 天前
百度 bs4 doc
|
![]() |
4
NotFoundEgg 71 天前
divs = soup.findAll(name='div', attrs={"class": "dateDiv"})
for div in divs: if '2022.04.18' in div.next: table = div.find_next('table') |
5
Joshuam 71 天前 via Android
推荐个 chrome 插件:SelectorGadget
只需点点点你要的数据,他给你 CSS Selector ,然后使用 bs4 处理 CSS Selector |
![]() |
6
AmberJiang 65 天前
建议查看 BS4 的官方文档学习
|