python问题求解答

题目描述

AttributeError: module 'pandas' has no attribute 'DataFrame'

题目来源及自己的思路

编程遇到

相关代码

import requests
from lxml import etree

url = 'https://book.douban.com/subject/1084336/comments/'r = requests.get(url).texts = etree.HTML(r)
file = s.xpath('//div[@class="comment"]/p/span/text()')import pandas as pd
df = pd.DataFrame(file)
df.to_excel(pinglun.xlsx)

你期待的结果是什么?实际看到的错误信息又是什么?

在网上搜过的解决方式都没用,求各位大神解疑!


慕森卡
浏览 1130回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python