Comments (3)
def get_pages(self):
"""获取全部微博"""
self.get_user_info()
gender = u'女' if self.user['gender'] == 'f' else u'男' #性别
import pandas as pd
user = {}
user['ID'] = self.user['id']
user['昵称'] = self.user['screen_name']
user['性别'] = gender
user['微博数'] = self.user['statuses_count']
user['微博粉丝数'] = self.user['followers_count']
user['微博关注数'] = self.user['follow_count']
user['微博简介'] = self.user['description']
user['微博等级'] = self.user['urank']
user['微博会员等级'] = self.user['mbrank']
df = pd.DataFrame([user])
df.to_excel('%s个人信息.xlsx' % self.user['screen_name'], index=False)
page_count = self.get_page_count()
wrote_count = 0
self.print_user_info()
这样就可以了,或者将创建df的代码修改为:
df=pd.DataFrame(index=[1])
也可以。
from weibo-crawler.
好的,非常感谢~~
from weibo-crawler.
def get_pages(self): """获取全部微博""" self.get_user_info() gender = u'女' if self.user['gender'] == 'f' else u'男' #性别 import pandas as pd user = {} user['ID'] = self.user['id'] user['昵称'] = self.user['screen_name'] user['性别'] = gender user['微博数'] = self.user['statuses_count'] user['微博粉丝数'] = self.user['followers_count'] user['微博关注数'] = self.user['follow_count'] user['微博简介'] = self.user['description'] user['微博等级'] = self.user['urank'] user['微博会员等级'] = self.user['mbrank'] df = pd.DataFrame([user]) df.to_excel('%s个人信息.xlsx' % self.user['screen_name'], index=False) page_count = self.get_page_count() wrote_count = 0 self.print_user_info()
这样就可以了,或者将创建df的代码修改为:
df=pd.DataFrame(index=[1])
也可以。
非常感谢大佬~~看来我要学的还有很多很多
from weibo-crawler.
Related Issues (20)
- 关于时间和位置信息的爬取问题 HOT 2
- 运行过程中出现KeyError: 'card_group'
- 运行过程中出现KeyError: 'card_group' HOT 7
- 希望增添 since_date 对时间的支持 HOT 1
- 调用weibo_crawler时group ‘Nonetype’ HOT 1
- 安装依赖遇到command not found怎么解决 HOT 1
- 抓取某一条微博的所有评论数据 HOT 1
- 运行时提示main文件里需要schedule_interval参数 HOT 1
- feature request: jsonc support HOT 1
- Aug 30 版本无法下载超过9张图的原创微博,第10张起都不下载 HOT 1
- 配置了数据库信息,但实际创建数据库连接报错 HOT 1
- 数据库表问题
- 数据库表问题 HOT 1
- 微博用户注册信息 HOT 1
- string indices must be integers, not 'str' HOT 3
- max_id_type错误 HOT 1
- 如果是长微博出现'全文'字样爬取不全 HOT 3
- 半年可见限制 HOT 1
- 可不可以把爬取到的评论直接以csv的格式显示,不放在sqlte数据库里面 HOT 1
- 批量下载时,中间有提示错误,但是下载还是继续,其他微博的下载也正常 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weibo-crawler.