我正在尝试使用BeautifulSoup从html文件中获取结果:
with open(r'/home/maria/Desktop/iqyylog.html', "r") as f:
page = f.read()
soup = BeautifulSoup(page, 'html.parser')
for tag in soup.find_all('details'):
print tag
这里的问题基本上是iqyylog.html文件包含2500多个节点。解析时,加载数据需要时间。有没有其他方法可以解析包含大量数据的HTML文件。当我使用lxml解析器时,它只占用前25个节点
试试这个
如果仍然存在问题,请尝试以下操作
相关问题 更多 >
编程相关推荐