Crawling post details from Sina Weibo through keyword seraching
- xlrd
- xlwt
- xlutis
- selenium
$ pip install xlwt
$ pip install xlrd
$ pip install xlutis
$ pip install selenium
username = "[email protected]" #你的微博登录名
password = "#########" #你的密码
book_name_xls = "weibo_test.xls" #填写你想存放excel的路径,没有文件会自动创建
Note: Output file will be in .xls Excel file. If file does not exist, a new .xls file will be produce. If file does exist, output data will be written into the sheet which its name is same as current keyword search, if not, a new sheet will be produced.
keywords = ["can", "high", "worry", "case"] #输入你想要的关键字,建议有超话的话加上##,如果结果较少,不加#
Keywords can be a list of keywords.
Sometime selenium webdriver was not able to find or select the button control. Data Crawling is forced to stop. (without implement exception handling yet)
As title
- Arthor: By TKT for FYP testing purpose
- Resource & Reference: To be update