你好,我想从这个网站解析或报废数据。你知道吗
我的问题是该网站如何只获取从“18努沙登加拉帖木儿”到“145萨布赖华”的数据
谢谢你的回复,我试着用查找所有和其他,但我弄错了。你知道吗
import bs4
import request
html = request.get(link)
soup = bs4.BeautifulSoup(html,"html.parser")
soup.prettify()
ul = soup.find("ul", id="sitemap")
for li in ul.find_all('table'):
if "Jawa Timur" in li.text.strip():
print(li.nextSibling())
我不知道你想要什么格式的输出。最初,您可以只选择相关的表,如下所示。需要bs4 4.7.1+as使用:contains和:has进行筛选。你知道吗
如果您希望输出类似于您在评论中的图像,那么请使用以下命令(您需要使用测向列)你知道吗
我已经用输出中的单词
tick
替换了ticks的图像。输出示例(某些行隐藏):阅读:
相关问题 更多 >
编程相关推荐