├── .idea
├── .gitignore
├── dianping.iml
├── inspectionProfiles
│ └── profiles_settings.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── README.md
├── analy
├── BosonNLP_sentiment_score.txt
├── analy_shop.py
├── choose_foodtype.py
├── createsql.py
├── gender.py
├── keywords.txt
├── out.png
├── price.py
├── shop_clouword.py
├── table_content.py
├── transfer.py
├── user_location.py
├── user_table_shop.py
└── yz.py
├── dianping
├── __init__.py
├── __init__.pyc
├── dbhelper.py
├── info.json
├── items.py
├── items.pyc
├── middlewares.py
├── pipelines.py
├── pipelines.pyc
├── settings.py
├── settings.pyc
└── spiders
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── comment.py
│ ├── comment.pyc
│ ├── dianpingspider.py
│ ├── dianpingspider.pyc
│ ├── user.py
│ └── user.pyc
├── images
├── 1.png
├── 10.png
├── 11.png
├── 12.png
├── 13.png
├── 14.png
├── 15.png
├── 2.png
├── 3.png
├── 4.png
├── 5.png
├── 6.png
├── 7.png
├── 8.png
└── 9.png
└── scrapy.cfg
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/.idea/dianping.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # dianping
2 | scrapy抓取数据存储至本地mysql数据库
3 | 基于python开发,采用scrapy,数据存储至本地数据库(或excel表格)
4 | 程序的主要目的是完成抓取和分析的任务同时学习爬虫相关知识,所以在细节处理上略有不足,但考虑到最终的目的是记录自己的学习,另外帮助到他人学习,所以这些细节无关紧要(毕竟不是面向用户的程序)。
5 | 程序还有建立商家-用户点评的表格还在进行中...
6 |
7 | 也许你可以在这里找到一些帮助,比如:一次返回两个,多个item,切割中文,中文转数字等问题
8 |
9 |
1)一次返回两个、多个item
10 | 在pipelines.py文件中,可以看到。如果是不同的spider返回的,直接根据spider的name来判断即可
11 |
elif isinstance(item, User_shopItem):
12 |
13 |
2)而一个spider返回两个、多个item,则通过item的name来判断(item的名字可以在spider中调试并输出)
14 |
if str(str1) == "":
15 |
16 | 一次抓取
17 | ------
18 | 1.首先创建MySQl数据库
19 |
在/dianping/settings.py中写定了
20 |
MYSQL_DBNAME = 'dianpingshop'
21 |
MYSQL_USER = 'root'
22 |
MYSQL_PASSWD = 'yourpassword'
23 |
当然你也可以修改
24 | 
25 |
26 | 比如选择6,创建程序用的所有表格
27 | 
28 |
29 |
30 | 2.根据Scrapy的常用语法抓取数据
31 |
32 | 比如运行scrapy crawl dianping抓取扬州地区前50页的数据
33 |
34 | 
35 |
36 | 抓取的数据存储在本地MySQL数据库中,当然之后也可以转换成Excel表格
37 | 
38 |
39 | 二次抓取
40 | ------
41 | 用户选择某种种类继续抓取(考虑到日常生活中,人类大多数会从某一种类中选择某一商家)
42 | 
43 |
44 | 在已经抓取的yangzhoushop总选择所有种类为自助餐的数据,存入dianping表中,等待继续抓取
45 | 
46 |
47 | 运行Scrapy crawl comment抓取点评内容,和点评人的具体信息
48 | 
49 | 转格式
50 | -----
51 | 运行transfer.py把数据从MySQL中导出到Excel表格中
52 |
53 | 
54 | 
55 |
56 |
分析
57 | ---
58 | 运行yz.py 生成地理位置的条形图(这一步骤是刚开始学习时编写的,所以数据是写定的)
59 |
60 | 
61 |
62 | 运行price.py显示价格相关的条形图
63 |
64 | 根据横轴的价格增长,三条曲线分别为
65 |
1)红色:消费人数
66 |
2)蓝色:商店数量
67 |
3)黄色:评分
68 | 
69 |
70 |
运行gender.py
71 |
显示男女比例,vip、非vip的比例
72 | 
73 |
74 |
运行user_location.py显示用户地理位置的分布图
75 | 
76 |
77 |
运行analy_shop.py分析具体商家
78 | 
79 |
80 |
程序显示几家商店,从中继续选择某一家分析
81 |
生成词云
82 | 
83 |
--------------------------------------------------------------------------------
/analy/analy_shop.py:
--------------------------------------------------------------------------------
1 | # -*- coding:utf-8 -*-
2 | from os import path
3 | from scipy.misc import imread
4 | import matplotlib.pyplot as plt
5 | import jieba
6 | from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator
7 | import MySQLdb
8 | import sys;
9 | reload(sys);
10 | def analy_shop(shop_id):
11 | sys.setdefaultencoding('utf8');
12 | db = MySQLdb.connect(host="localhost", user="root", passwd="yourpassword", db="dianpingshop",charset='utf8')
13 | cursor = db.cursor()
14 | sql = """select distinct content from pagecomment where shop_id = %s ;""" %shop_id
15 | tweets = open("keywords.txt", "w")
16 | cursor.execute(sql)
17 | for row in cursor:
18 | print>>tweets, row[0]
19 | tweets.close()
20 | db.close()
21 |
22 |
23 |
24 | def seek_num(key, af_value):
25 | db = MySQLdb.connect("localhost","root","yourpassword","dianpingshop" )
26 | cursor = db.cursor()
27 | cursor.execute('select shopurl from dianpingshop order by %s desc limit %s' %(key,af_value))
28 | results = cursor.fetchall()
29 | temp = []
30 | for i in results:
31 | #tempInt=int(i[0])
32 | #print tempInt
33 | print i[0]
34 |
35 | temp.append(i[0])
36 | db.close()
37 | return temp
38 |
39 | if __name__ == '__main__':
40 | shop_collection = []
41 | numx = int(raw_input("Please input the num of shop: "))
42 | shop_collection = seek_num('reviewnum', numx)
43 | print shop_collection
44 | for which_one in range(0, numx):
45 | print "input %s to select:" %which_one + shop_collection[which_one]
46 | shop_collection[which_one] = filter(lambda ch: ch in '0123456789', shop_collection[which_one])
47 | print shop_collection[which_one]
48 |
49 | choice = int(raw_input("Please input the choice: "))
50 | print "you choose :" + shop_collection[choice]
51 | choicestr = '\'' + shop_collection[choice] + '\''
52 | analy_shop(choicestr)
53 |
54 |
55 | stopwords = {}
56 |
57 |
58 | # 加载stopwords
59 | def importStopword(filename=''):
60 | global stopwords
61 | f = open(filename, 'r')
62 | line = f.readline().rstrip()
63 |
64 | while line:
65 | stopwords.setdefault(line, 0)
66 | stopwords[line] = 1
67 | line = f.readline().rstrip()
68 |
69 | f.close()
70 |
71 |
72 | # 中文分词(jieba)
73 | def processChinese(text):
74 | seg_generator = jieba.cut(text) # 使用结巴分词,也可以不使用
75 | seg_list = [i for i in seg_generator if i not in stopwords]
76 | seg_list = [i for i in seg_list if i != u' ']
77 | seg_list = r' '.join(seg_list)
78 |
79 | return seg_list
80 |
81 |
82 | importStopword(filename='BosonNLP_sentiment_score.txt')
83 |
84 | # 获取当前文件路径
85 | # __file__ 为当前文件, 在ide中运行此行会报错,可改为
86 | # d = path.dirname('.')
87 | d = path.dirname(__file__)
88 | text = open(path.join(d, 'keywords.txt')).read() # 读取love.txt文件内容
89 | # 如果是中文,使用结巴分词
90 | text = processChinese(text)
91 | # 设置背景图片
92 | back_coloring = imread(path.join(d, "out.png"))
93 | # 生成词云, 可以用generate输入全部文本(中文不好分词),也可以我们计算好词频后使用generate_from_frequencies函数
94 | wc = WordCloud(font_path='/System/Library/Fonts/Hiragino Sans GB W3.ttc', # 设置字体
95 | background_color="black", # 背景颜色
96 | max_words=2000, # 词云显示的最大词数
97 | mask=back_coloring, # 设置背景图片
98 | # max_font_size=100, #字体最大值
99 | random_state=42,
100 | ).generate(text)
101 |
102 | # 从背景图片生成颜色值
103 | image_colors = ImageColorGenerator(back_coloring)
104 |
105 | # 绘制词云
106 | plt.figure()
107 | plt.imshow(wc.recolor(color_func=image_colors))
108 | plt.axis("off")
109 | plt.show()
110 |
111 | # 保存图片
112 | wc.to_file(path.join(d, "out1.png"))
113 |
--------------------------------------------------------------------------------
/analy/choose_foodtype.py:
--------------------------------------------------------------------------------
1 | # -*- coding : utf-8-*-
2 | # coding:utf8
3 | import MySQLdb
4 | import sys
5 |
6 | reload(sys)
7 | sys.setdefaultencoding('utf8')
8 |
9 | def scrapy_type(foodtype):
10 | db = MySQLdb.connect("localhost","root","yourpassword","dianpingshop" ,charset='utf8')
11 | cursor = db.cursor()
12 | #cursor.execute('insert into dianpingshopx (select * from dianpingshop where foodtype = "自助餐") ;')
13 | #cursor.execute('insert into dianpingshopx (select * from dianpingshop where foodtype = %s' %(foodtype))
14 |
15 | sql = """insert into dianpingshopx (select * from yangzhoushop where foodtype = %s)""" %foodtype.encode("utf-8")
16 | cursor.execute(sql)
17 | print "create table sucessful!!"
18 | db.commit()
19 | db.close()
20 |
21 |
22 |
23 | if __name__=="__main__":
24 | raw_input_A = raw_input("input foodtype: ")
25 | print "the foodtype you choose is:%s" %raw_input_A
26 | foodtype = str(raw_input_A)
27 |
28 | raw_input_A= '\'' + raw_input_A+ '\''
29 |
30 | scrapy_type(raw_input_A)
31 |
--------------------------------------------------------------------------------
/analy/createsql.py:
--------------------------------------------------------------------------------
1 |
2 | def createdianpingshop():
3 | import MySQLdb
4 | conn = MySQLdb.connect(host='127.0.0.1', user='root', passwd='yourpassword', charset="utf8")
5 | cursor=conn.cursor()
6 | cursor.execute("""create database if not exists dianpingshop""")
7 | conn.select_db('dianpingshop')
8 | sql = """CREATE TABLE dianpingshop (
9 | shopname CHAR(45) NOT NULL,
10 | shoplevel CHAR(45),
11 | shopurl CHAR(45) primary key,
12 | reviewnum INT(10),
13 | avgcost INT(10),
14 | taste FLOAT,
15 | env FLOAT,
16 | service FLOAT,
17 | foodtype CHAR(45),
18 | location CHAR(45)
19 | ) DEFAULT CHARSET=utf8"""
20 | cursor.execute(sql)
21 | cursor.close()
22 | print "Create database&table dianpingshop sucessful!"
23 | #db.close()
24 |
25 | def create_user():
26 | import MySQLdb
27 | conn = MySQLdb.connect(host='127.0.0.1', user='root', passwd='yourpassword', charset="utf8")
28 | cursor=conn.cursor()
29 | conn.select_db('dianpingshop')
30 | sql = """CREATE TABLE user (
31 | city CHAR(45) NOT NULL,
32 | gender CHAR(45),
33 | birthday CHAR(45) ,
34 | is_vip INT(11),
35 | contribution INT(11),
36 | _id INT(11) primary key,
37 | user_name CHAR(45)
38 | ) DEFAULT CHARSET=utf8"""
39 | cursor.execute(sql)
40 | cursor.close()
41 | print "Create table user sucessful!"
42 |
43 | def create_pagecomment():
44 | import MySQLdb
45 | conn = MySQLdb.connect(host='127.0.0.1', user='root', passwd='yourpassword', charset="utf8")
46 | cursor=conn.cursor()
47 | conn.select_db('dianpingshop')
48 | sql = """CREATE TABLE pagecomment (
49 | content LONGTEXT,
50 | user_id INT(11) primary key,
51 | stars TEXT(45),
52 | avg_cost TEXT(45),
53 | shop_id INT(11),
54 | label_1 TEXT(45),
55 | label_2 TEXT(45),
56 | label_3 TEXT(45),
57 | _id INT(11),
58 | user_name CHAR(45),
59 | likes TEXT(45)
60 | ) DEFAULT CHARSET=utf8"""
61 | cursor.execute(sql)
62 | cursor.close()
63 | print "Create table pagecomment sucessful!"
64 |
65 | def create_user_list_shop():
66 | import MySQLdb
67 | conn = MySQLdb.connect(host='127.0.0.1', user='root', passwd='yourpassword', charset="utf8")
68 | cursor=conn.cursor()
69 | conn.select_db('dianpingshop')
70 | sql = """CREATE TABLE user_shop (
71 | shopname CHAR(45) NOT NULL,
72 | shopurl CHAR(45),
73 | shoplevel INT(5),
74 | _id INT(11)
75 | ) DEFAULT CHARSET=utf8"""
76 | cursor.execute(sql)
77 | cursor.close()
78 | print "Create table user_shop sucessful!"
79 |
80 | def createyangzhoushop():
81 | import MySQLdb
82 | conn = MySQLdb.connect(host='127.0.0.1', user='root', passwd='yourpassword', charset="utf8")
83 | cursor=conn.cursor()
84 | #cursor.execute("""create database if not exists dianpingshop""")
85 | conn.select_db('dianpingshop')
86 | sql = """CREATE TABLE yangzhoushop (
87 | shopname CHAR(45) NOT NULL,
88 | shoplevel CHAR(45),
89 | shopurl CHAR(45) primary key,
90 | reviewnum INT(45),
91 | avgcost INT(10),
92 | taste FLOAT,
93 | env FLOAT,
94 | service FLOAT,
95 | foodtype CHAR(45),
96 | location CHAR(45)
97 | ) DEFAULT CHARSET=utf8"""
98 | cursor.execute(sql)
99 | cursor.close()
100 | print "Create database&table yangzhoushop sucessful!"
101 |
102 | if __name__ == '__main__':
103 | print "Enter 1:create database"
104 | print "Enter 2:create user"
105 | print "Enter 3:create pagecomment"
106 | print "Enter 4:create user_shop"
107 | print "Enter 5:create yangzhoushop"
108 | print "Enter 6:create all tables"
109 | choice = int(raw_input("Input your choice:"))
110 | if choice == 1:
111 | createdianpingshop()
112 | elif choice == 2:
113 | create_user()
114 | elif choice == 3:
115 | create_pagecomment()
116 | elif choice == 4:
117 | create_user_list_shop()
118 | elif choice == 5:
119 | createyangzhoushop()
120 | elif choice == 6:
121 | createdianpingshop()
122 | create_pagecomment()
123 | create_user()
124 | create_user_list_shop()
125 | createyangzhoushop()
126 | else:
127 | print "Error!"
128 |
--------------------------------------------------------------------------------
/analy/gender.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | from matplotlib import pyplot as plt
3 | import numpy as np
4 | import MySQLdb
5 |
6 |
7 | def seek_num(key, label, af_value):
8 | db = MySQLdb.connect("localhost","root","yourpassword","dianpingshop" )
9 | cursor = db.cursor()
10 | cursor.execute('select %s from user where %s = %s' %(key,label,af_value))
11 | results = cursor.fetchall()
12 | tempInt =0
13 | for i in results:
14 | #try:
15 | tempInt=int(i[0])
16 |
17 | db.close()
18 | return tempInt
19 |
20 |
21 | if __name__ == '__main__':
22 | X1 = []
23 | X2 = []
24 | vip_count = seek_num('count(*)', 'is_vip', 1)
25 | no_vip_count = seek_num('count(*)', 'is_vip', 0)
26 | vip_per = float(vip_count)/(vip_count + no_vip_count)*10
27 | vip_per = int(round(vip_per))
28 | no_vip_per = 10 - vip_per
29 |
30 | man_count = seek_num('count(*)', 'gender', '\'man\'')
31 | woman_count = seek_num('count(*)', 'gender', '\'woman\'')
32 | man_per = float(man_count)/(man_count + woman_count)*10
33 | man_per = int(round(man_per))
34 | woman_per = 10 - man_per
35 | print man_per
36 |
37 | X1 = np.array([no_vip_per, woman_per])
38 | X2 = np.array([vip_per, man_per])
39 | bar_labels = ['vip', u'性别:男/女']
40 | fig = plt.figure(figsize=(8,6))
41 | y_pos = np.arange(len(X1))
42 | y_pos = [x for x in y_pos]
43 | plt.yticks(y_pos, bar_labels, fontsize=10)
44 | plt.barh(y_pos, X1,
45 | align='center', alpha=0.4, color='g')
46 | plt.barh(y_pos, -X2,
47 | align='center', alpha=0.4, color='b')
48 | plt.xlabel(u'是/非')
49 | t = plt.title(u'用户基础信息')
50 | plt.ylim([-1,len(X1)+0.1])
51 | plt.xlim([-max(X2)-1, max(X1)+1])
52 | plt.grid()
53 | plt.show()
54 |
--------------------------------------------------------------------------------
/analy/keywords.txt:
--------------------------------------------------------------------------------
1 | 物美价廉贝壳类的东东挺多,扇贝,生蚝,花甲,鱿鱼…重点是很新鲜,以我这么脆弱的肠胃第二天没有闹肚子就能验证商家挺有新意,弄的k歌大赛炒热气氛,只是奖品太鸡肋没法用,有点失望
2 | 自助式 既有烤肉 又有火锅 菜的品质也都还不错 这个价格实惠到家
3 | 值得一去的美食好去处,实惠美味。期待下次有机会再来。
4 | 一共去了2次,一次非周末,人不会特别多,一次周末,生意挺好。我们都是中午去吃,人少的时候服务人员会全程帮你烧烤,只有坐着动嘴就好啦。人多的时候,服务人员会时不时帮你换烤纸,散油,翻动食材,这个时候自己动手也不错噢。食材如果没了和服务人员反映下,过会儿他们就会上新的食材。生蚝,鱿鱼,虾,昂刺鱼都会供应呢。我比较喜欢培根和鱿鱼,妈妈喜欢各种鱼类。每次都吃的饱饱哒,特别是靠家近,好方便呢
5 | 这个价位也就这样吧,之前好像可以洗澡,现在就是一张10块的卷
6 | 带小孩在奇乐儿玩到午饭时间就顺便到这家来吃自助餐,正好店家搞活动小孩不收钱而且两个大人还送了两张洗澡券,那真是太划算了,菜品虽然不是很多,但样样都很清爽,特别是盘子很大,方便拿取菜品,省得多跑路,虾很新鲜不像一般店上面都沾着冰,不要等划开直接就可以放进小火锅里煮,烤肉区里猪排非常赞,我一个人就吃了三块,最好还吃了好多昂刺鱼。服务员的服务态度都很好,会主动帮你烤制食物,这里停车也比较方便,饭后直接拿结帐票据抵停车费。
7 | 在扬子江中路,乐天玛特北边,聚龙湾楼上;味道不错和服务都不错,就是中午生意太好,可能要自己动手烤肉,最爱牛排和骨肉相连,老板很会做生意,经常举办唱歌比赛评选周月冠军,还送很多奖品哦,一边吃自助,还可以K歌,吃完出了汗还送聚龙湾澡资券,真是一条隆服务啊,正如老板说的老板没文化,吃饭娱乐化!
8 | 还不错,价格合理,东西也挺多!
9 | 环境不错,服务也很到位。正好赶上搞活动,还有免费洗澡券赠送!
10 | 菜品很丰富,火锅和烤肉都有这一点很好,就是离家远了一点,
11 | 还不错 值这个钱 又烤又涮 蛮有意思的
12 | 很不错的自助,有服务员为你烧烤,还送免费的洗澡卷,性价比很高
13 | 一开始进去有点失望,感觉菜品不是很多,就两个圆台,烤肉区有牛排、培根、香肠、鱼;水果区有油桃、香蕉、哈密瓜;海鲜区有公蟹、虾、鱿鱼、贝壳;丸子只有牛丸一种,有炒饭等热菜,可以到厨师处领肥牛卷和肥羊卷,没有冰饮料,自调饮料特别淡。对了,培根好咸好咸!环境确实不错,有唱歌台,影响不错,歌都是还不错的精选,空调有点不给力!服务很好,会帮忙烤肉特别到位。因为我们到的早还没其他人,店员会认真检查各角落卫生,但是,应该是没注意到饮料区的很多小飞虫。还送了楼下洗澡的券,对了,好像到8.1,学生凭学生证全天39元,可惜了没带呀!吃得好撑,谢谢服务!
14 | 点com环境布置都很温馨,柔和的灯光舒服宽大的双人沙发,桌上镶嵌两个锅具,烧烤,火锅两不误 。烧烤火锅材料琳琅满目,海鲜,鱼虾透着新鲜的光泽,各式肉制品小圆子有十几个品种,还有腌制好的猪排,牛排,肉串等烧烤美味蔬菜,水果,主食,饮料,调料更是数不胜数。我们各取所需,烧烤,火锅同时进行。觉得个个都喜欢最好吃的当数虾子,鱿鱼卷,我个人还喜欢用粽叶裹的粽子,感到t特别还有糯軟
15 | 真是无语,既然限制人数为何还要卖那么多的团购,让大家白跑,差评!
16 | 完全是商家搞的噱头,这边当天的团购券没有限制的卖那边却发号牌控制人数,下午4点去就没有了,没有这个能力就不要搞这样的促销,如果大家都是冲着19块钱价格去的我宁愿不吃。差评!
17 | 认识点COM,还是之前大众点评的优惠爆单抢购,这次终于带着家人去了。11点到,比较早,还没什么人,菜品已全部摆上了。点COM位于乐天玛特的北面,聚龙湾旁边,二楼的面积挺大的,可见老板也是投资了不少钱。四人位的桌子有四个小火锅位,一个烧烤盆位,小火锅的底锅是免费的,菜品自助。蔬菜是比较新鲜的,海鲜也有一些蟹脚、虾什么的,就是好像没看到什么小蛋糕,热饮不多。吃完后,店家还送了免费的洗澡券,去去身上的火锅味考虑周到。其他服务感觉一般。
18 | 第二次去啦,服务依旧很好,菜品补充也很及时,不错哦~
19 | 经济实惠,价廉物美,还有洗澡券送的自助餐厅!实在不错!
20 | 很合算也很好吃感觉吃的东西很新鲜!
21 | 完全搞噱头,你要吗就控制团购数量,团了又吃不到,白跑了,不如吃佳客来!
22 | 分量足,不止一次去了,经常小聚在这里
23 | 有烤有涮!很不错,就是感觉菜品在多些就好了
24 | 环境和服务都很好,但菜的新鲜度有待加强
25 | 很丰盛呢,品种多,牛蛙,昂刺鱼~都无限量供应,而且服务人员很热情,及时周到,超级好!还送澡卷,环境很棒!!
26 | 东东非常好,吃得很饱,孩子们也非常喜欢!
27 | 不错的地方!聚会聚餐的好场所!不贵菜还可以
28 | 关门太早 7点半刚到 8点多就准备打烊了 哎
29 | 喜欢,一家三口7扣去的,吃的很开心
30 | 很喜欢,东西新鲜又不贵,而且还送澡票,很划算
31 | 环境不错,里面东西不多但总体觉得比较新鲜,另外服务态度棒棒嗒
32 | 跟同事聚会去的,真的觉得服务态度是所有自助餐里面最好的。烤肉的时候有服务员帮忙,连拿东西那边的阿姨都个个笑脸相迎。肉的质量都不错,特别是牛排,所有肉腌制的都特别鲜嫩,这点特别满意~~每天晚上,这里还有唱歌比赛,觉得挺热闹挺嗨的,老板的创意真的很不错~!
33 | 非常喜欢这家店!就是人气不怎么旺
34 | 烤肉品种不多!主要是以火锅为主!调味料不太好吃!也主要适合火锅!环境,服务都很好!
35 | 去了几次感觉菜不是很好吃的,人好少啊
36 | 基本还是比较满意,就是排烟效果一般。。。
37 | 不错,还可以。气氛也不错的啦。
38 | 经济实惠,菜品新鲜,服务到位,口味很不错呦,吃的很欢快,都忘了拍照了~嘻嘻
39 | 装修风格很不错 服务员服务也是非常到位
40 | 口味一般吧,种类也不是很全,不过烤肉不错的
41 | 整体还是不错的,特别是开业特价的。最不开心的就是看团购说有洗澡赠送的,但是去了解释原价之后才有活动。我想说。。。没有活动大众上就不要写啊,多让人误会啊。不过排队真是要命啊,环境很好,服务蛮好的,有个服务员小哥特别帅,哈哈。东西种类蛮多的,有烧烤有火锅。甜品饮料有待提高。
42 | 快到有效期转给朋友吃了,看他点评没有以前好了,希望能保持高质量的服务噢~我之前去的都是很满意的
43 | 上菜太慢!现场团购的就放在一边不问了!明显歧视啊!人家有牛扒我们没有!下次不会再去了!!!
44 | 很不高兴,都约好朋友团好团好卷,去那排队,说有限制,不高兴,不愉快,果断退掉。
45 | 蛮好的'第二次去'就是沙发好矮啊'对于身高超出172的女生来说坐着超级难受,望老板多考虑一下买几个靠背'体贴一下客人好不好'
46 | 还不错 价格便宜 不过菜品不是很多 每天都不大一样 烤肉比较少...
47 | 在乐天玛特北边 聚龙湾那块价格很实惠 服务态度也特别好还帮忙烤肉什么的 都不好意思了还送了两张洗澡券就是椅子不太舒服坐着很不方便 希望更换一下然后黄彬的态度棒棒哒哈哈哈哈哈
48 | 还行,就是调料味道不行。其他还好
49 | 品种丰富,味道佳,服务好,尤其黄彬亲自为我们烧烤服务,很感动呀,最重要的是价格低,以后多多惠顾,超级赞!!!
50 | 比较满意,推荐给我朋友?你™逗我玩的吧。
51 | 不错,口感,服务还蛮好的。去了两次点赞
52 | 菜品挺少,人也挺少,服务员态度挺好,希望以后有机会再来
53 | 非常满意,服务态度很好,上菜也很迅速
54 | 好呢!我们吃的很嗨,有锅还有烤肉
55 | 环境不错,还有唱歌比赛,拿了奖,但是没啥用,参与就行吧
56 | 清明一家人去扬州玩,吃的地方都人气爆棚,偶遇点com,还是挺有氛围的,
57 | 很好吃,火锅加烧烤非常棒,还有唱歌比赛看
58 | 烤肉好吃 火锅也不错 吃过后洗个澡 棒棒哒
59 | 挺好的,服务很周到,种类也挺多的。
60 | 用餐环境好一点,口味一般吧,菜品总体质量不是很高,海鲜类的很难熟,都是冷冻很久的
61 | 价格优惠,每个人54元,随便吃,环境比较温馨,职业唱歌,服务好,给五星
62 | 性价比比较高 口味不行 建议提高价位 提高菜品
63 | 该店位于扬子江中路乐天玛特超市旁边,聚龙湾休闲中心二楼,作为一名老客户,时隔一段时间再来消费,感觉不如从前了。首先,购买团购券后,还要再加5元现金锅底费,还有,原来赠送的是免费洗浴券,现在是赠送10元抵用券,洗澡还要再加10元,另外,菜品好象也没有以前丰富了,昂刺鱼没了,虾子等了半天也不见上货,但相比其他同行,还是不错的,希望店家能够加大优惠力度,留住更多的食客。
64 | 新开的店,就在乐天玛特旁边,位置跟方便,在聚龙湾的2楼!!!可以选择的东西很多,就是才开业人多,很多菜才上就没有了,环境不错,就是油烟味有点重。培根很好吃,饮料都是大品牌!!!
65 | 还行,对得起39.9的优惠价,三五朋友小聚倒是不错选择。印象较深的是生蚝。
66 | 超级划算,这个价位对的起食客了。吃完饭后还提供免费沐浴。愉快……
67 | 去的太晚了,所以吃的比较仓促,没有拍照,就说的详细点吧。首先个人感觉没有刚开业的时候好吃了,肥牛感觉不是牛肉,吃在嘴里怪怪的,很烂没有嚼劲,没有牛肉的味道。然后是饮料部分,刚开业的时候是大牌子的饮料,现在换成了比较廉价的汽水,冰红茶,还有香精色素调制的果汁。熟菜的话看起来多,其实也并没有多少,放的时间有些久了,比如泡椒凤爪都已经有肉冻了。然后是火锅烤肉的菜品,还比较多,特别是烤肉现在还加了鲳鳊鱼和肉饼。去吃的时候送了聚龙湾的洗澡券,挺好的。但是对于火锅来说肥牛真的很重要,我宁愿吃冻好的也不想吃现割的没什么牛肉味的,还有锅底可以做的浓一些,微辣的锅底有些太辣了希望改良一下。以上是个人看法,仅供参考。
68 | 服务态度给一万个赞!就是人气好像不太旺啊。。。
69 | 一般般吧。。不是很带劲。。上菜非常慢
70 | 图片上有些东西根本就没有,扇贝没有,鸡胗也没有,鱼片我们刚开始用餐时上了一次直到我们用餐结束也没再上过,去拿肉类时问刨肉的阿姨这是牛肉卷还是羊肉卷,直接回我一句‘反正就是肉’,秒懂!烤肉只有干粉没有烤肉酱,所以吃五花肉时还是有点腻的,环境不错,服务态度好,这点值得表扬的~
71 | 帮朋友团的,习惯给好评,改天自己去吃吃看
72 | 服务还行,服务员小伙子、小姑娘都挺热情的。菜品品种对得起这个价了,我觉得还是蛮值得。有烤肉、有涮锅吃的挺开心的。最后还有唱歌比赛。朋友去唱了一首,不过因为我们去的人少,投票的人自然也少,那个XX号嚎的那么难听居然还第一,唉!谁叫人家是大伙人聚餐呢!老板想用歌唱比赛这种方式带动气氛是挺好的,不过规则有待商榷,建议改进!
73 | 中午的菜品很少,有的东西也不是很新鲜!
74 | 一家可以点歌可以洗澡的烤肉店!没错,你没看错!首先说下环境,进来放的歌真的很像八十年代迪斯科,不过,后来才知道这是用来点歌的!吃嗨了,聊嗨了,还能唱嗨!真是很用心的一家店!菜品还算多,但是烤肉的肉类太少了,鸡翅很小,只有培根,如果是去吃烤肉,就会失望。但是自助来说,还是很多品种的,海鲜,蔬菜,肉类,牛排,还有冰淇淋,可以吃火锅,是烤肉火锅于一体的。水果沙拉很好吃。服务员也很耐心,不过客人很少知名度没有打上去,宣传不到位。服务员真的很有礼貌,问了我们很多意见。首先,烤肉酱太少,烤肉吃的不香。其次,烤肉种类少,没有烤猪肉,五花肉。最后,没有多人聚餐的大桌子,只有一个六人桌。
75 | 好评味道还不错服务也挺好的给好评
76 | 吃了好几次了,非常不错。值得去。
77 | 有唱歌比赛,边吃边听歌,服务态度不错
78 | 自助的菜品不多,送澡券。牛羊肉没有,只有五花肉。
79 | 点com位于扬子江中路乐天玛特旁边,地理位置及佳,一楼是聚龙湾休闲中心,二楼是点com自助烤肉火锅,吃完火锅还可以沐浴休闲是个非常不错的好去处,点com刚开不久昨天去尝了下,非常棒,又可以火锅还可以烤肉两者可同时进行,味道也相当棒,菜种品种类繁多特别喜欢它家自制的猪排,还有冰淇淋也很好吃,居然一下吃了六个球,调料种类很多就是服务人员少了每次有事都要大声招呼,也许刚开业不久生意好,人手不够吧,值得谅解,价位不贵,以后会常去。
80 | 吃完饭还可以用送的洗澡券泡个澡,舒服!
81 | 吃得很饱,菜品丰富,海鲜也有不少品种哦!服务员一直忙个不停,虽然没有海底捞那样的服务,呵呵…本来是想以烤肉为主的,最后海鲜吃了不少。还有洗澡券送,真的很不错!
82 | 9.9抢的,很划算,只是虾不太新鲜,找服务员拿东西都分区域,不在他的区域内不给服务。
83 | 很棒的自助~还送了澡劵~~~~
84 | 不错,现在不要锅底,还免费洗澡,划算!
85 | 挺好的,环境卫生,食品都不错,下次还会去
86 | 味道棒棒哒,服务热情哒,各种哒
87 | 第一次来,味道一般,环境不错,价格还行
88 | 还不错,带老公和妈妈去的,有两张票是之前9.9抢的,一张正常价格团,很划算哦。服务也很好,烤的就培根、香肠,品种不多,涮的蔬菜不错,冷饮是美伦的,总体还不错
89 | 比较满意的,吃过饭,有送的洗澡劵,吃饭的过程还有些小活动
90 | 菜品满多的,服务也超好,特别是有个帅哥服务员黄彬全程服务,超赞!
91 | 去吃过两次~环境和特色都赞!貌似每晚都有K歌比赛!爱好唱歌的可以去玩玩吃吃,还送25聚龙湾的洗澡票!吃完火锅烤肉一身汗还可以下楼洗个澡回家就舒舒服服睡觉!当然发现一个爱吃海星的人类也算收获了
92 | 菜品和环境都很不错,下次还会再去
93 | 还可以,以秒杀价得的券吃的饱饱的!
94 | 第一次来吃,在乐天玛特北边一点。本来对自助火锅没什么好印象!这次是朋友带我去次的。当天正好下雨人还可以,不需要排队!走进一看环境非常好,还有KTV的小台子供客人唱歌的。装修风格很不错,卫生看起来也很整洁!服务态度非常好。烤肉都是服务员给烤的!总之味道美美嗒!环境赞赞的!心情好的不要不要的!下次还会去次的
95 | 品种挺多,味道也还可以,停车也方便
96 | 东西很新鲜、环境很赞,下次还会去吃
97 | 地址位于扬子江路乐天玛特超市隔壁,聚龙湾2楼!总体评价,性价比高,实惠!哈哈,七夕那天去的,没事干,很早就去了!去的时候正好才营业,服务员还在开会!我们进去就找地方坐了下来!第一次去,不知道是先买单的,就坐那干等,以为服务员会过来点餐!服务员没有给客人正确的引导,有待改善!后来听说要先买单,就自己去吧台买单,点好底锅,给我们安排了别的座位,只得重新找到座位坐下来!菜品比较多,水果:西瓜,葡萄,哈密瓜,香蕉等。海鲜:梭子蟹,基围虾(比较小),扇贝,生蚝,蛤蜊,鱿鱼,小黄鱼,长虾脚等。蔬菜:土豆,山药,莴苣,粉丝粉皮,生菜,青菜,大白菜,黑木耳,菌菇,诶呀,还有好多我想不起来了。酒水饮料:小瓶装雪碧,橙汁,啤酒,机器装的饮料,盒装的雪梨,红茶等。烤肉:鲳蝙鱼,培根,牛排,骨肉相连等,冰激淋:美伦品牌的,小布丁,老冰棍。调料:烤肉的,火锅的调料都有!冷菜:泡椒风爪,泡椒海带,盐水花生,蜜糖红枣,酱翅尖等。熟菜芹菜炒牛柳,还有忘了,嘿嘿!包子,薯条等等!吃的东西真的很多吧!就不一一列出来了!强调的是,我看到水果沙拉上面有小飞虫!建议服务员多关注下,菜肴的卫生!我们点了生蚝,烤的当中服务员主动过来帮我们烤制,好周到,很好吃!点!这个服务员给我舀泡沫,加烤油,换烤纸,真的很细心,很认真!火锅底锅味道挺好的!人均消费晚餐49一位(团购)!吃到饱,吃到撑!我推荐哦!关键还送洗澡券一张,吃完就在聚龙湾洗个澡,火锅味就没有了!不过夏天我的两次券都浪费了没去!
98 | 店铺的位置就在乐天马特的背面,位置很好,停车方便,还有洗浴城呢,太好了。自助餐的环境很好,空间很大,服务员很热情。菜品很多,味道很好!海鲜也很不错,非常推荐。个人感觉比大红帆好几个档次!性价超高,良心推荐!
99 | 菜品种类还好,比较新鲜,服务周到,可以烤,也可以吃火锅,环境不错,店里放的歌曲都是我喜欢的,只是自己食力不行,吃了一轮就看别人在那吃了。
100 | 菜真的很干净,虾子和鱿鱼很新鲜,服务员还给我们烤肉,真是只需要埋头吃,下次还回去的
101 | 棒棒哒,和男朋友吃的很多,性价比很高~~就是爱吃的三文鱼木有,其他不逊于多伦多♥
102 | 非常喜欢 已经来了好多次了 菜的种类也多 这次还有龙虾吃 太赞了
103 | 环境不错,有火锅和烤肉,和小伙伴吃的很开心。
104 | 很好吃,服务也很到位。下次还去
105 | 吃的东西很多,挺新鲜,很划算,服务态度也很好
106 | 挺好的,性价比很高,服务也好,赞一个!
107 | 一口气写了所有点评,我已疯!啦啦…
108 | 东西品种很多,挺好吃的,可以烤肉,可以涮菜,凭个人爱好选取,勤拿少取,杜绝浪费,环境也很不错,吃完了还可以洗把澡,可以开开心心的来,舒舒服服的走。服务业很到位。下次还会再来的。
109 | 只能说一般吧,晚上很吵!!!服务还行
110 | 性价比挺高的,还可以吧,第二次
111 | 布局改过了,调料碗变的特别小,饮料兑的水也太多了,喝起来就跟水一样,我觉得就算节约成本也不能这样吧,以前锅底是不要钱的,现在锅底五块钱一个人,总体来说,整体水平下降了,吃的一点也不舒服,特别是饮料这一块,太不走心了,兑那么多水!服务员也找几个好一点的吧,有个人跟T说的话光应着,根本就不执行。
112 | 总体还可以吧,没有想像的那么好!!
113 | 买了让老爸去吃的,貌似很喜欢,我自己也去过好几次了。好评。
114 | 价格合理 环境干净 有情调 不错
115 | 环境各方面不错。。。。。。。。
116 | 人超级多的,海鲜类基本都没有的,补充不及时,羊肉牛肉也不多,只有蔬菜吃吃,蛋糕甜点就更别提了!!
117 | 来吃了很多次了,味道一直不错,服务很棒,k歌比赛也是一大特色阿
118 | 菜的品种挺多的,就是排队排到死呀~有位蛮不讲理的大爷差点打起来!服务员态度挺好的,不过团购说送的洗澡券没有送,骗子!!!
119 | 环境蛮好,服务态度也不错,菜品种还可以,可能今天第一天有些菜品没了来不及供应,总体不错
120 | 重新装修后第一次过来,环境很不错,服务态度也很热情,可以烧烤可以火锅,都很方便,虾类肉类贝壳类鱼类都很新鲜,各类蔬菜水果也一应俱全,饮料冰淇淋都有,地理位置也很好,乐天玛特旁边很好找,停车也很方便,价格经济实惠
121 | 之前听朋友说不好吃,来试了一下,每个人感觉不一样吧,我觉得很好,跟我一起去的朋友也挺满意,正好碰上唱歌比赛,很新鲜,还会再去的!
122 | 很棒了 因为还送浴室票 环境棒
123 | 菜蛮清爽~环境也不错~烤肉火锅可以一起吃~服务好~下次还会来哒
124 | 非常棒,气氛好,材料实!下次跟朋友聚会再去!
125 | 很满意饿的一次团购啊,比刚开业那会好多了,尤其遇到了一位很有热心的服务员黄彬,吃的饱饱的啊
126 | 环境很好但是菜品太少,而且一次不如一次,总有一种不想再去的感觉,吃的不过瘾,饮料挺单一的。不喜欢不能自己随意吃冰淇淋的那种,很压抑。服务员收盘子很及时,但是老盯着客人看,有的时候还指指点点,特别是厨房的大妈们,唉我也是醉了。不是很满意。
127 | 很好很好,好评好评。东西不错,主要送洗澡卷哈哈
128 | 不错!环境好!服务好!东西好!吃的很撑!东西多!
129 | 味道很好,地方也很好。11路直接到地方。
130 | 去的时候有点晚,很多东西都没有了。有唱歌的地方,吃饭的话感觉有点吵,朋友玩玩挺好的。服务特别好,一位叫黄彬的帅哥一直在服务,很贴心,所以才觉得不错啦。
131 | 还行 档次不算高 中等水平吧 火锅加烧烤
132 | 东西好少这次来吃。可能是周一没多少菜
133 | 菜很丰富洗澡券也不错,还会再去吃
134 | 准备中午吃的没想到居然限制人数,没办法只好晚上吃了,排了一个小时的队,不说了
135 | 还行吧,经济实惠,对得起这价格
136 | 朋友介绍的地方,环境还可以,菜品也比较丰富,主要还有海鲜,真不错!
137 | 反正无可挑剔的好吃。下次还会再来
138 | 已经第二次来这里了, 感觉还是蛮不错的, 晚上还有K歌大赛, 很有娱乐性,菜品也是那么多, 真的挺值的
139 | 团购的好便宜,很划算,可以烤肉还有小火锅
140 | 品种虽多但是不开空调也没有冰水不过吃完还可以免费洗澡不错
141 | 很棒哦!!冰淇淋特别好吃!我吃了好多哦!环境挺好的
142 | 中午去的,人不多,冷气比较足,服务员帮忙烤肉,态度很好,菜品蛮多。海鲜不是很新鲜
143 | 不错,还有唱歌活动,感觉品种不是很多。但也够
144 | 忍不住再次点赞,很喜欢这家店,环境好,服务好
145 | 环境不错,东西也挺丰富的,对得起这个价格,还会再去的。
146 | 有点不划算,品种少。。。。宝宝半价。
147 | 他们家不仅环境好,服务好,食物也很美味!去了好几次了,真心不错!!
148 | 还好 就是不太新鲜东西,没什么人去吃
149 | 还可以,团购挺实惠的,菜品再多点就更好了
150 | 环境不错,但是烤肉的调料很少,肉品种也很少,牛羊肉都是鸭肉,感觉是以火锅为主,很一般没特色,个人感觉不会再去
151 | 等了一个多小时,等来的却收空盘子,郁闷S了!吃的好少,都不补的!
152 | 蛋挞太少了.一个都没吃到.肥牛是要一次切两盘,再要一次再切两盘,有时人不在还要喊。上次去吃的时候是每次去拿都有四五盘切好了摆在那随时补充。
153 | 很好,满意的团购,想吃的猪排,培根,五花肉什么的都吃到了,蛮喜欢蛋挞,蛋糕和冰激凌的,吃的很饱。
154 | 很好 很棒的 味道蛮好 环境也挺好
155 | 很棒的聚餐地方 吃的种类也很多 大家试试呗
156 | 唯一优势就是价格还是比较便宜的,就是选择的品种不是很多
157 | 什么都好,凳子如果是独立的就好了,空间味道处理一下,味道本身就大。
158 | 有点情调的一家店,火锅烤肉自助,一张桌子全搞定,服务也很好。
159 | 味道不错,火锅酱不错,跟边涮边捞差不多,但是口味比那个好多了
160 | 菜少了很多,没有之前的菜多了,不是太好
161 | 环境还是不错的服务也很好,就是菜的品种少了点希望以后增加菜的品种。
162 | 味道环境都很好,服务态度也非常赞
163 | 我只能说这个地方环境很好,位于乐天玛特附近,楼下是洗浴中心,吃完饭可以洗个澡。店里的菜肴品种很多,烤肉也有但是品种不多,火锅东西倒是很多,我唯一不满意的就是服务,因为他家的服务员超级多,吃饭的时候她就往你旁边一站,看着你吃看着你聊。这个希望能改进。
164 | 菜不是很多,但有唱歌比赛气氛很好
165 | 环境好~菜色还不少~吃的饱饱的回去的
166 | 已经吃了很多次了,下次去感觉菜品还是那几样,建议可以更换一些菜品了,要不吃客会味觉疲劳的,现在火锅底料还收了10块,不过在这里吃饭感觉很不错,还有人在台上献唱,很喜欢
167 | 过来人好多,,爆满,,难得到这不太熟悉,不过还是一眼看到了,,也为不会太大,,但是有点出乎意料,装修不错,听说是刚开业的,,服务员挺热情的,,有烤肉和和火锅一体的,不过好像来不及吃……也有好多小点心,有冰淇淋噢,,也没有限制,,,饮料不错,,还有猪排不错,,,店里氛围不错,,下次还过来……不过觉得菜适合火锅,,烤肉的菜不多,,不过够吃了………和我一块吃的阿姨高潮,,电脑程序,淘宝,团购,余额宝……我都惊呆了
168 | 动动手指头抢来的团购券还真是相当给力,味道不错,品种蛮齐全的,环境也很卫生
169 | 周六去的 几乎爆满了 等了一会才给上的锅,这次是鸳鸯大锅,来了几次第一次吃大锅,还是挺爽的,哈哈,菜的方面呢,还是不错的,人很多,还赶上有人过生日,,唱了生日歌,还有人跳舞,现场很热闹,下次还会去的,哈哈哈 哈 哈哈 哈哈 哈!!!!!!!!!!
170 | 第二次了,还不错,就是中午菜品比晚上少了很多,这点让人难以接受,价格便宜,就可以忽悠客户吗?
171 | 位置还是比较好找的,乐天玛特超市旁边,就是以前的时代超市。点com在聚龙湾二楼,环境必须的高大上,服务也很热情~~刚坐下来就有美女过来给我们开锅,服务员也不是特别拘束很大气热情~还很逗呢~~看见他们间的互动笑点也很多~就喜欢这样融洽的环境~这店的调料种类还是很多的,也大部分和偶胃口~吃着就觉得好爽~其次还得说说这家的菜品,火锅的种类倒是不少,可烤肉的种类也太少了吧……感觉今天去吃的只有培根可以多吃点...牛肉有点难咬...筋太多了,咬不动啊,真真是臣妾做不到啊~~火锅的种类倒是不少,还有不少海鲜,只可惜这些海鲜不适合烤...烤出来的味道其淡无比...建议弄些可以烤的海鲜出来...其实我们今天出来本意是想吃烤肉的...结果吃了不少火锅...可见点com的肉种类真的太少...火锅的味道还是很棒的~
172 | 这个价格能吃到这样的还不错,口味还行
173 | 环境很好,人不是很多,菜的种类也蛮多的,有火锅和烤肉,还有音乐节,挺好的
174 | 猪排味道很好,蔬菜挺新鲜,总的菜类感觉偏少。服务员礼貌又周到,但有时候一个服务员帮我们翻过烤肉后一会会儿,另一个服务员就又来翻,我想这个方面是不是可以改善一下。
175 | 差差差,一个字都不想再说,永远不会再想去的地方。
176 | 朋友和他老公一起去的,很不错哦,大家可以来看看
177 | 价格便宜 东西吃不了多少 年纪大了 哈哈哈 自助种类挺多的
178 | 很好,菜品还可以,关键价格蛮实惠的,还送洗澡,太划算了
179 | 菜品少,太少了~~~连个热饮都没有,熟食也没几个~~~不过服务态度还是不错滴~~~
180 | 环境不错,味道挺好,和同事一起去的都挺满意
181 | 环境和服务都一流,下次还会和朋友一起来的
182 | 带爸妈一起去的,爸妈吃的很开心..服务也不错哦
183 | 太垃圾了,一点都不好吃下次再也不去了。
184 | 好,很好,非常好,!我觉得吃的非常好呢
185 | 是在大众吃喝玩乐群里看见有人说这家好吃,于是带女朋友过来尝尝,确实不错,服务员很热情,一直帮忙翻肉,浇油,感觉比多伦多好多了,推荐他们家的猪排,带骨头的那种,味道不错,感觉和牛排一样的口味,我一直以为牛排,音乐餐厅,很惬意,7点钟还有点歌环节,上去给女朋友唱了首歌,吃撑了都没法唱了,好评。
186 | 这家的烤肉不错,海鲜好吃还有冰淇淋不错
187 | 总体感觉不错,有氛围,服务周到,菜品数量挺足,好话说不尽,总之下次一定再去
188 | 位置不算很偏,宿舍聚餐去的,总得说性价比还行。 一人一个小锅,可以自选锅底。我点的清汤锅底,舍友点的微辣和中辣,微辣还行,中辣辣爆了! 可能是我不能吃辣,能吃辣的可以去试一试哦!点心不是很多,冷菜也不多,烧烤类的东西还行,就是熟的蛮慢的。 感觉在吃比较自由的麻辣烫哈!环境还是不错的,虽然吃完也有烧烤味。但是总得和其他比起来还是不错的,下次有机会还会来的。
189 | 黄彬服务真好!!!38个赞,三天来了两次,你说好不好吃,要不要来!!!
190 | 不足一米二的孩子要钱有点接受不了
191 | 很好。味道不错。环境不错。服务不错。好
192 | 不错,不错,还送了洗澡券,下次还会再来噢………
193 | 不错的,下次去扬州还去这家,环境好,便宜又实惠,必须
194 | 报名大众试吃很荣幸中奖,点com位于扬子江中路,刚开业不久,环境很不错,晚上六点去人好多,自助烤肉和火锅都有,价位也不高,烤肉是现刨的限量,每次就拿一份,有点少哈,饮料不错都是品牌的,自助菜品很多很丰盛,用餐很满意!
195 | 很满意,平价且实惠〉_〈。吃了好几个冰淇淋球
196 | 很满意,服务很到位,和妹妹去得,吃的很开心
197 | 环境很好,布置非常不错,还可以点歌唱歌,只限三人,由顾客点评,胜出者获得免餐卷,就是菜式少了点,总体来说还是非常好的。
198 | 服务很好 环境好喜欢 晚上还有K歌赛不错 喜欢
199 | 不错,服务很好,值得再来哦,还有唱歌比赛
200 | 环境不错。味道也不错就是花样少点。总得是性价比可以。以后会经常去。
201 | 还不错哦!团购很实惠,建议加个烤肉酱哦!
202 | 不错,挺不错的,就是不错嘛……
203 | 一如既往的好,吃的很饱!!!!
204 | 不错,服务挺好的,也比较好吃!!!
205 | 很像小酒吧,服务非常好,帅哥一直在帮烤肉。还有k歌比赛,气氛非常好
206 | 菜很多、选择也很多、还有免费的澡劵赠送
207 | 还不错,又可以吃火锅又可以吃烤肉,味道也不错
208 | 环境一流,在扬州来说这个价格值得
209 | 地址好找,环境也不错,服务态度也很好,就是给我们挖冰淇淋的阿姨当时在聊天,很嫌烦的给了我们一人一个冰淇淋,让我有点小不开心,其它的都喜欢
210 | 气氛非常好,我不会唱歌,所以没能施展!会唱歌的朋友一定更喜欢这里!
211 | 口味很好,服务周到,物美价廉,很不错的选择。
212 | 菜的样式不多,味道还不错,服务很周到
213 | 和老公去吃的,还不错,服务挺好,菜也不错,就是甜品有点少!
214 | 不错然后就恩艰难的决定基督教大喊大叫
215 | 在乐天玛特附近自助烤肉种类蛮多的 服务态度很不错还经常有唱歌活动赢了好像有奖品什么的还送了洗澡券
216 | 去了几次了,又想去了,老板很好玩,还玩驻唱,还有各种比赛,多去多去
217 | 不错哦,环境服务都蛮好的,值得推荐
218 | 仿佛要好好和 i 把 v 复古风方法
219 | 没有第一次吃的有感觉,感觉没什么想吃的了,这种自助还是偶尔吃比较好
220 | 第一次来,很不错。食物也都是新鲜的,气氛,感觉很高大上。管理,服务,都很不错。我很开心。就是,服务员告诉我们11.00才能拿食物,但是自己不听劝。起哄。导致服务员们被领导说。甚至服务员每人还可能被罚款10元。想到这我就内疚。都怪自己不懂事。。知道我是寿星,还送了鸡蛋面,很贴心!给12个赞^O^。希望老板可以看在我生日的份上,不计较这次的事情了。也希望各位来吃烤肉火锅的朋友们,遵守店里的规矩,不要给服务员们带来困扰。毕竟,不守规矩,不成方圆。下面来看看店里的图片吧!!!
221 | 性价比很高,比甘泉路两家都要好,服务也不错
222 | 一般般啦!吃过比他高档的,就觉得很一般,没啥感觉。
223 | 味道一般,服务也是一般,刚开业那几天人特别多,东西也吃不到什么。。。
224 | 还行,找了挺久,服务不错,种类多
225 | 一般吧,还可以,随便吃吃,觉得自助都差不多
226 | 环境还可以,就是油烟装置不是很好,菜色还行吧,装修不错。不贵。
227 | 好不错,就是要早点去,不然8点后就开始收拾了,我就是去迟了都没吃到水果,其他口味什么的都不错,时候同学聚会
228 | 口味一般般喽 还是蛮难找的 就这样吧
229 | 很好、很实惠,就是品种少了点,下次有机会还会去
230 | 负责切西瓜的阿姨,有西瓜你不给,何必呢
231 | 一般,口味不好,尝试一次,够了
232 | 和朋友一起去吃的、还不错的!!!
233 | 非常满意,价廉物美,下次还来哦
234 | 还不错环境很好,服务也不赖,东西品种不多但很清爽
235 | 很好。好吃 而且服务态度都很好。环境也不错。而且还可以点歌 唱歌。还有K歌活动。
236 | 团购还是挺划算的。还送澡卷。环境很好,服务员的态度没的话说
237 | 时间有点赶,没怎么吃,菜品好像也不多,不过服务小哥很殷勤。
238 | 店面位置距离我们学校比较近,这一点比较好,然后吃饭的地方在二楼,一楼是沐浴的,洗个澡吃个自助餐很赞耶。。。环境也还可以,蛮有古典风格的。烤肉味道真不错,特别是培根,有特别的口感。!可以烤肉,还可以吃火锅,真全面,这一点也不错。。。
239 | 不是太好吃,东西有点少。。。。。。
240 | 不错,有生蚝,扇贝,菜很足,环境也不错,就是有点热
241 | 扬州算性价比比较好的烤肉自助了!喜欢烤翅!每次都吃好多!
242 | 一直在点评上看到这家评价很好,就来了,环境自不用说,带KTV形式的,可以唱歌,唱歌第一名的还送晚餐券一份,灯光很舒服,有烤肉,有火锅,火锅是一人一锅,卫生方便,汤底自己选,选的养生锅汤底,配上自己调的酱料,棒棒哒!再说服务,期间服务员一直有帮忙烤肉,餐盘也很及时。整整吃了1个半小时,都没停过(嫁不出去了,估计)在说说菜品,有我喜欢吃的鱿鱼,虾(很容易满足的)火锅的菜品也很丰富,冰激凌,冰棍,蛋塔不错哦,汽水(3,4种口味吧)果汁,好吧,把我自己都说饿了!最最划算的是送了洗澡券,吃完立马去享受了,洗澡的环境也很赞,服务也特别好,各种东西都备好,洗面奶等等,免费的毛巾,还额外自费了一个珍珠粉护体,还蒸了一下,估计排了好多毒,总而言之,言而总之,满意,满意,超级满意(真替老板操心,挣不挣钱啊)不多伦多赞,这是我的感受。
243 | 还可以的,很不不错的,吃了好多次了
244 | 不错,很满意!味道好,服务好⊙▽⊙,很好很好!
245 | 反正我没吃到,看门口全是大妈就吓尿了哈哈,目测不咋地,搞得跟菜市场一样一样
246 | 朋友去的,说还不错,东西还挺多的
247 | 非常好,服务态度满意,服务员很漂亮
248 | 菜不是很多,也没看到大龙虾,不过吃的很开心,阿姨很幽默
249 | 气氛挺好的,唯一遗憾的是小龙虾不上了。团购划算,还送洗澡券,值得推荐。
250 | 来过一次觉得不错,所以这次带孩子一起来吃
251 | 味道不错,菜品质也好,还能k歌。
252 | 环境优雅干净,服务态度不错,就是烧烤的东西有点少。
253 | 有了改善,水果多了,蔬菜少了,服务没笑容
254 | 一分钱一分货,这个价位算值了。
255 | 去了居然不让进 还说过两天让我们加价去吃 没能力搞就别让我们团
256 | 环境还可以,菜就一般,洗澡不错哦,可以打球
257 | 挺好的。 服务也不错。 环境很好呢。点赞
258 | 一直喜欢在那吃,环境服务都很好,喜欢
259 | 第一次来吃。很不错。非常喜欢。下次还来哦。
260 | 就这样吧,东西很少,没什么可吃,火锅和烧烤一体的
261 | 还不错,火锅烤肉一起吃,挺实惠,味道还不错。
262 | 环境不错,服务还行,菜品比较新鲜,品种不是很多,但够吃了
263 | 服务态度超好,收盘子很及时。菜品也不错,种类一般。送澡票不错。唯一不足的地方就是排风不够,人多的话味道有点呛。
264 | (。・ω・。)ノ♡小帅哥服务很好呀 嘻嘻嘻 喜欢死辣 点的辣的锅底 一级棒 吃了好多肉肉肉 服务员一个劲的给我们拿肉 嘻嘻嘻我是食肉の少女 自己还参加了K歌比赛 没出结果就走辣 残害了大家的耳朵 还送了澡票子 然而并没有卵用 我并不要洗刷刷洗刷刷 总得来说 32个赞
265 | 价格便宜,品种还可以,适合两人用餐
266 | 去过两次,吃了很多,菜色需要更新?
267 | 已经退步了,饮料种类变少,食品种类变少。但是服务还是不错的。
268 | 环境很棒哦,东西很新鲜,冰激凌用的是缇兰圣雪的,赞呢
269 | 就很一般拉,味道也一般,东西也不够多
270 | 菜也太少了,被评分给骗了…………………………
271 | 很好 不多说了 很多次去的地方 我也推荐朋友来几次
272 | 很满意,菜色很多,家里长辈说不错。就是人多,需要排号。
273 | 非常实惠 非常好吃 以后还会再来的
274 | 好,不错,下次继续,大家尝试下
275 | 还不错,价格实惠,聚会的好地方
276 | 还不错,又能烤肉还能涮火锅,服务员服务不错,还会帮着烤
277 | 挺不错的,两种都能吃到,下次还会再来!
278 | 吃过大江南北n多火锅,没见过这么神奇的锅…大家可以看下图…
279 | 即能烤肉又能火锅,好吃不贵,环境挺好的,菜式很齐全,服务态度好
280 | 赞呢相当划算,味道不错性价比高
281 | 环境赞呢!口味我喜欢!不错值得推荐!瘦瘦的那个短发美女服务很好会再次光临的!
282 | 还不错,小火锅味道很好,烤肉也不错,经济实惠
283 | 好,方便。最近生意不错,人气旺
284 | 团了给朋友去吃的,自己也经常去,味道不错
285 | 味道挺不错的,环境蛮好的,菜的品种很多很丰富,吃的很实惠,值得大家去吃哦。
286 | 今天很满意,人很多,菜品也很全
287 | 菜品丰富,口味不错!孩子也喜欢!下次还会去!
288 | 去过很多次了,不错,还有娱乐节目!
289 | 中午去的,菜品没有晚上多,但是不错的
290 | 美餐美餐美餐,沐浴美食两不误,休闲好去处!
291 | 吧台美女很漂亮,菜的口味很好,服务态度很好
292 | 去了好多次了。食品依旧是那么美味。服务也很到位。中途还有唱歌比赛活动。还得了第一名呢。和同事们一起去的。都说很好吃。强力推荐亲们去品尝。大爱。下次还会去的。
293 | 环境还可以,菜式太单调,希望能多式样.
294 | 就这样吧 味道不怎么样 但是环境挺好的 服务也可以 有点小贵
295 | 海鲜增加了,服务一如既往的热情。
296 | 挺好吃东西还送澡票呢!下次还去
297 | 感觉很好,第一次跟同事们来的,这次带家人来吃,都感觉很好
298 | 还不错,味道还行,吃得很饱!可以
299 | 环境很好,有酒吧的感觉,人不多很安静,物有所值!
300 | 环境不错。 吃的哎真心不好。 也不新鲜。 买教训吧。
301 | 很满意,觉着服务态度很好!下次还想去的
302 | 不错,很好吃,品种多,团购超便宜!
303 | 不知道,没说三张澡票没给我!!!现在补给我呀
304 | 环境,口味不错,性价比较高。。
305 | 味道特别好,品种也多,里面的牛羊肉很正宗哦,吃了好多次还会再去
306 | 很满意!环境好,朋友聚会吃饭需要的就是气氛,服务很好,吃的心情好,蔬菜很新鲜,唯一遗憾的是羊肉卷味不太正,不过不影响心情,很开心,下次聚会还选你家!
307 | 不错,真的很好,是看老顾客了,菜式很多,服务态度好,还能唱歌呢
308 | 口感不错,菜品种也多,服务员态度很热情!给赞
309 | 总的来说还可以,就是甜点少了点,嘻嘻,我和室友们都喜欢甜食(〉﹏〈)
310 | 环境还可以,就是味道不怎么样,而且菜品太少
311 | 帮朋友团的,我也去吃过,不团购价格有点高。
312 | 一次非常满意的消息!环境好!服务好!菜肴口可!
313 | 环境真的很好,食物也很好吃,样式很多很精致,服务也很周到
314 | 环境还行服务也好,但很多菜品质略逊点不太正宗
315 | 挺有氛围的,菜也挺新鲜的,节日还有活动,
316 | 环境好,东西也好吃,超级合算,几个人聚会棒棒哒
317 | 蛮好吃的,不错哦,下次还会去的,环境卫生都不错,
318 | 服务非常好,肉几乎没自己动手烤过,烤的牛排很好吃,菜品很丰富
319 | 环境挺好的,东西也干净味道挺好的吃的饱饱的
320 | 还不错 带爸妈去吃的 味道更好一点就更好了
321 | 火锅烤肉一体,很方便很喜欢,价格又便宜
322 | 这个价位,东西很不错,也值得再去
323 | 去吃就是图一个实惠,性价比还不错。吃了还能弄把澡,舒服!
324 | 非常满意,品种很多,也很干净。孩子特别喜欢吃冰淇淋,很不错哟!
325 | 感觉不错 吃的也挺好 烤肉也不错
326 | 吃的好说的好。烤肉火锅吃的都很爽啊
327 | 环境优雅,菜色多,服务态度非常好,划算!
328 | 很喜欢到点COM,环境好,菜品新鲜,里面的工作人员从领班到服务员都很客气,感觉到吃饭是一种享受!已经不止一次过来了,这次来还带了老爸老妈过来吃,他们也感觉挺好的,烤肉有猪排,五花肉,培根,小黄鱼,鲳扁鱼等,火锅菜品也很丰富,希望再多点好一点的果汁和水果,因为孩子们去也吃不了什么东西,只有果汁和水果还适合他们!总得来说还是不错的,还有KTV,简直太享受了,以后再多点优惠就更好了!不错,全五分,赞一个!
329 | 真的是超划算的自助餐,在扬州这样价位的自助餐真的少见,关键是服务,环境,菜品还不错,有烤肉,有汤锅,酒水,最爱蛋挞,冰淇淋也好吃,只吃了一点,棒棒的!里面还有唱歌比赛,赢了有奖品哦~吃饭,听歌两不误,可惜本人五音不全
330 | 还不错哦,服务态度也不错,可以下次再去哦
331 | 第一次和妹妹去吃,感觉吃的很爽,东西很多,菜品还算干净,烤肉和火锅都有,不过火锅不咋地,之后去吃就没有第一次吃的带劲了。。看来还是不能多吃啊
332 | 口味绝对的,环境很优雅,服务很周到
333 | 已经去过一次,相比扬州的其他一些自助餐,我觉得点com还是比较实惠的,看上去也挺有档次的,卫生做的也比较好,环境也是没话说,菜的种类也可以!个人特别喜欢吃烤培根,这次和老公是带爸爸去吃的,可惜爸爸身体不是很舒服,所以都没怎么吃,等以后爸爸妈妈来我这了,我还选择他家,祝生意兴隆,越办越好!
334 | 49块吃到好多东西决对物超所值吃完还送张洗澡券!
335 | 好吃,环境超级好,下次聚餐还杀到这里来!特别是A区服务特别周到,超级细心
336 | 很不错的地方,服务和3很好,可以常去
337 | 第二次来了,感觉还是一样好!下次还会再来的
338 | 环境不错,品种也挺多,服务态度也非常好!
339 | 一般吧,不是太好,而且有好多感觉是头一天剩下的多。还送的澡票也不尽人意,因为澡堂的服务态度太差了
340 | 不错的环境 食物也不错 服务也很到位
341 | 首先店的位置还是比较好找的,就在乐天玛特的北边一点点,自助烤肉在二楼,里面环境还不错,还是比较宽敞的,也还挺干净的,菜品种类一般,还算比较新鲜的,个人比较喜欢烤的牛羊肉和金针菇,味道还是挺不错的。家庭小聚还是蛮适合的!
342 | 还不错,同事聚餐,种类很多,吃的很饱,还会再来
343 | 这是从哪儿看你了:在线播放联合传播
344 | 品种比开业的时候少太多了 服务员也不帮着烤了 好多菜都没有 开始将就了
345 | 环境服务都是很不错的,很好吃,是吃货的理想去处
346 | 服务员态度好,打扫的阿姨态度也好,菜还是蛮新鲜的
347 | 很好,支持店家细致入微的服务,记得母亲节那天送来的康乃馨很暖心呀!
348 | 还是不错的,不过我们去晚了,吃饭快下班了但服务员还是很有耐心
349 | 创意餐厅 可以尝试 还不错
350 | 菜很新鲜、干净。口味也不错很喜欢,下次还会光顾
351 | 赞~~谢谢大众点评美女现场指导团票
352 | 整体还不错吧,老板也行。。。。。
353 | 还行,适合动手能力比较强的小伙伴
354 | 比上一次来有所改进,但是不能容忍的失误是,服务员居然把醋当作蓝莓汁装在瓶子里~
355 | 已经第三次去了,这次带朋友一块来的,都赞不绝口
356 | 挺划算的一家自助餐馆!烤肉火锅都有,海鲜也有!可以吃饱吃好,价廉物美啊!
357 | 服务呕心的一塌糊涂,就这样的服务在好吃的东西都不会在来,才8点钟就开始打扫卫生噼里啪啦的,都把客人都赶走了,经理是干嘛用的,垃圾,下次请老子都不来,活该做不下去没生意,好好和海底捞学学吧垃圾
358 | 还行服务员长的不错,就是音乐有的吵
359 | 好吃 周五和同学一起去吃的 很实惠哦
360 | 已经去过几次了,口味服务都很好,就是海鲜品种略少点,有的位置空调不够,别的都蛮好。
361 | 已经是第二次去吃了,本来因为只有周末人多,谁知道星期二还这么多人。物美价廉,是个值得推荐的地方。
362 | 非常不错,和朋友一起,感觉很好
363 | 听说服务员会帮忙烤东西才来的,第一次来还有服务员帮忙烤肉和烤海鲜,这次去服务员和呆子一样,过来吹了几句牛,就在那晃晃悠悠,烤肉就算了,海鲜也不来弄一下,等我们自己烤糊了才过来,还怪我们,早干嘛去了,差评!!!本来心情很好的,结果吃的一点都不爽
364 | 很满意吃的东西都很好,很新鲜。还送了澡劵,洗的那叫个舒服什么都有。
365 | 今天下雨了,也挡不住吃货的脚步,第一次去,停车不方便,要收费的。餐厅环境不错,放着音乐,灯光忽闪忽闪的。调料区调料挺齐全的,酒水饮料都有,素菜也挺多,荤菜我不怎么吃,海鲜类的有点少。今天去赶巧了,有龙虾和螺狮,后悔只装了一小盘,那叫一个好吃啊,是我吃过最好吃的一家了。熟菜还有花菜和蒜苔炒鱿鱼,都挺好吃的,建议多加几种菜。火锅底料可以选择辣和不辣的,这点我很满意。服务员也到位,跟着忙里忙外的,服务员说还可以带1.3米下的小孩免费吃呢。最后走时,去卫生间,发现了亮点(有图有真相)。
366 | 满意!环境还可以,服务态度也很好,我还混了个日冠军,周六去玩玩
367 | 这个地方是真的好,很实惠比较值得来消费,环境也特别的好还可以唱歌
368 | 不错很好,服务到位,美味可口!
369 | 音乐有点吵~其他的都很赞!!!
370 | 好哥们过生日,很开心,他们家第二次来了,很开心!!!
371 | 很不错.下次还会去光顾的,孩子们都喜欢
372 | 吃的东西还好。还送洗澡卷。总体来说不错
373 | 还可以!就是水是咸的!你们懂得
374 | 还不错,就是火锅的味不够,饮料品种少,菜色挺丰富,服务员态度也不错。
375 | 挺不错的,食物种类蛮多的,吃的饱饱的
376 | 很好的一家自助餐厅、环境不错、服务也好、去过好几次了(●^o^●)
377 | 东京看起来没什么,东西也还好,
378 | 很实惠,吃的好饱!值得推荐哦!下次还会光顾的!
379 | 第一次来,和老公在门外转了几圈才看到,环境还不错,11点半到的,人还不是太多,服务员很贴心,、吃的一片狼藉了才想起片片没照、、、下次上哈!!!菜品挺多,也很新鲜,在舒缓的音乐声中、不知不觉吃的有些撑,对了,还送了两张洗浴票,还没消费!
380 | 还不错哟,棒棒的,呵呵呵,早知 不知道怎么
381 | 还好吧 味道都挺不错的 就是菜的品种少了点
382 | 经济实惠!环境不错!品种齐全!服务态度好!
383 | 很不错 KTV式的集火锅烧烤为一体的自助餐厅 菜品比较齐全 饮料种类也蛮多的 很不错的 比以前吃过的都好
384 | 已到该店吃过两次,荤素菜肴、酒水饮料品种多、新鲜,服务员服务热情、周到。
385 | 不坏非常满意已经多次在这里消费服务也较好
386 | 我们家三口团购的午餐139元,环境和服务都挺好的,交通也很方便,一家吃的饱饱的,性价比还是挺高的!关键老板还给了3张沐浴劵,吃过饭洗个澡放松一下,美美的,赞一个!下次再去!
387 | 的确很好的一家餐厅,不错不错,东西什么的都很好,下次还来,就是吃的生蚝挺多的,老板不会心疼吧,哈哈哈哈
388 | 挺好的!就是地图欺骗我走了好多路!种类还算够海鲜不是很新鲜但还好
389 | 一般还可,中午去的人少,不过火锅不怎么好吃
390 | 挺好的,菜还行,价格也划算,服务态度也挺好的
391 | 很好很.种类很全,口味也挺好的
392 | 环境不错,品类还可以,还有驻唱歌手
393 | 很不错,很有意境,还有音乐演奏。
394 | 很好,服务和菜品都不错。很喜欢
395 | 还不错,就是菜挺少的,不过环境挺好
396 | 味道不错,环境也很好,男厕所标语是亮点
397 | 跟朋友聚餐去的,环境很好,服务也很好
398 | 蛮好的 菜色也全 就是有几个服务员的态度不是很好 特别是领班 可能是我们去得晚了 有些肉没有及时补上
399 | 非常满意!下次我带我的朋友一起来这里聚会!
400 | 还行吧……就是给的洗澡劵办的有点拖拉
401 | 这次去洗澡票浪费了四张,不可能天天洗澡,不然会把皮洗掉的。
402 |
--------------------------------------------------------------------------------
/analy/out.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/analy/out.png
--------------------------------------------------------------------------------
/analy/price.py:
--------------------------------------------------------------------------------
1 | # coding:utf8
2 | import numpy as np
3 | import pylab as pl
4 | import MySQLdb
5 | import os
6 |
7 | def seek_num(key, content, pr_value, af_value):
8 | db = MySQLdb.connect("localhost","root","yourpassword","dianpingshop" )
9 | cursor = db.cursor()
10 | cursor.execute('select %s from yangzhoushop where %s between %s and %s' %(key,content,pr_value,af_value))
11 | results = cursor.fetchall()
12 | tempInt =0
13 | for i in results:
14 | try:
15 | tempInt=int(i[0])
16 | print tempInt
17 | except: pass
18 | db.close()
19 | return tempInt
20 |
21 |
22 |
23 | def show_price():
24 |
25 | x = []
26 | y = []
27 | z = []
28 | a = []
29 | for numx in range(10, 200, 10):
30 | x.append(numx)
31 | valuesy = seek_num('avg(reviewnum)', 'avgcost', numx-10, numx)
32 | y.append(valuesy)
33 | values = seek_num('count(*)', 'avgcost', numx-10, numx)
34 | z.append(values)
35 | valuesa = seek_num('avg(taste)', 'avgcost', numx-10, numx)
36 | a.append(valuesa*10)
37 | print x
38 |
39 | print z
40 | #pl.plot(x, y)# use pylab to plot x and y
41 | #pl.plot(x, y, z, '-or')
42 | pl.plot(x, y, '-r')
43 | pl.plot(x, z)
44 | pl.plot(x, a)
45 | pl.xlabel(u'价格')
46 | pl.ylabel(u'人数')
47 | pl.title(u'扬州的平均消费')
48 | pl.show()# show the plot on the screen
49 |
50 | if __name__ == '__main__':
51 |
52 | show_price()
53 |
--------------------------------------------------------------------------------
/analy/shop_clouword.py:
--------------------------------------------------------------------------------
1 | # -*- coding:utf-8 -*-
2 | from os import path
3 | from scipy.misc import imread
4 | import matplotlib.pyplot as plt
5 | import jieba
6 | from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator
7 | import MySQLdb
8 | import sys;
9 | reload(sys);
10 | def analy_shop(shop_id):
11 | sys.setdefaultencoding('utf8');
12 | db = MySQLdb.connect(host="localhost", user="root", passwd="yourpassword", db="dianpingshop",charset='utf8')
13 | cursor = db.cursor()
14 | sql = """select distinct content from pagecomment where shop_id = %s ;""" %shop_id
15 | tweets = open("keywords.txt", "w")
16 | cursor.execute(sql)
17 | for row in cursor:
18 | print>>tweets, row[0]
19 | tweets.close()
20 | db.close()
21 |
22 | analy_shop('2508199')
23 |
24 |
25 | stopwords = {}
26 |
27 |
28 | # 加载stopwords
29 | def importStopword(filename=''):
30 | global stopwords
31 | f = open(filename, 'r')
32 | line = f.readline().rstrip()
33 |
34 | while line:
35 | stopwords.setdefault(line, 0)
36 | stopwords[line] = 1
37 | line = f.readline().rstrip()
38 |
39 | f.close()
40 |
41 |
42 | # 中文分词(jieba)
43 | def processChinese(text):
44 | seg_generator = jieba.cut(text) # 使用结巴分词,也可以不使用
45 | seg_list = [i for i in seg_generator if i not in stopwords]
46 | seg_list = [i for i in seg_list if i != u' ']
47 | seg_list = r' '.join(seg_list)
48 |
49 | return seg_list
50 |
51 |
52 | importStopword(filename='BosonNLP_sentiment_score.txt')
53 |
54 | # 获取当前文件路径
55 | # __file__ 为当前文件, 在ide中运行此行会报错,可改为
56 | # d = path.dirname('.')
57 | d = path.dirname(__file__)
58 |
59 | text = open(path.join(d, 'keywords.txt')).read() # 读取love.txt文件内容
60 |
61 | # 如果是中文,使用结巴分词
62 | text = processChinese(text)
63 |
64 | # 设置背景图片
65 | back_coloring = imread(path.join(d, "out.png"))
66 |
67 | # 生成词云, 可以用generate输入全部文本(中文不好分词),也可以我们计算好词频后使用generate_from_frequencies函数
68 | wc = WordCloud(font_path='/System/Library/Fonts/Hiragino Sans GB W3.ttc', # 设置字体
69 | background_color="black", # 背景颜色
70 | max_words=2000, # 词云显示的最大词数
71 | mask=back_coloring, # 设置背景图片
72 | # max_font_size=100, #字体最大值
73 | random_state=42,
74 | ).generate(text)
75 |
76 | # 从背景图片生成颜色值
77 | image_colors = ImageColorGenerator(back_coloring)
78 |
79 | # 绘制词云
80 | plt.figure()
81 | plt.imshow(wc.recolor(color_func=image_colors))
82 | plt.axis("off")
83 | plt.show()
84 |
85 | # 保存图片
86 | wc.to_file(path.join(d, "out1.png"))
87 |
--------------------------------------------------------------------------------
/analy/table_content.py:
--------------------------------------------------------------------------------
1 | import xlwt
2 | import xlrd
3 | from xlutils.copy import copy
4 | import MySQLdb.cursors
5 | import xlsxwriter
6 | from xlrd import open_workbook
7 | from xlutils.copy import copy
8 |
9 |
10 | def excel_create(sheet, value, x, y):
11 | data = xlwt.Workbook()
12 | table = data.add_sheet(sheet)
13 | print x
14 | print y
15 | table.write(x,y,value)
16 | data.save('demo.xls')
17 |
18 | def excel_read(doc,table,x,y):
19 | data = xlrd.open_workbook(doc)
20 | table = data.sheet_by_name(table)
21 | return table.cell(x,y).value
22 |
23 | if __name__ == '__main__':
24 | conn = MySQLdb.connect(user='root', passwd='yourpassword', db='dianpingshop', host='localhost', charset="utf8", use_unicode=True)
25 | cursor = conn.cursor()
26 | i = 1
27 | file = xlwt.Workbook()
28 | table = file.add_sheet('table1',cell_overwrite_ok=True)
29 | for x in range(1, 194):
30 | for y in range(1, 19):
31 | _id = int(excel_read('/Users/bsns/Workspaces/analy/first.xls','table1',0,y))
32 | #print '_id='
33 | #print _id
34 |
35 | shop_id = int(excel_read('/Users/bsns/Workspaces/analy/first.xls','table1',x,0))
36 | #print shop_id
37 | cursor.execute('select shoplevel from user_shop where _id = %s and shopurl = %s ;' % (_id, shop_id))
38 | results = cursor.fetchall()
39 | insert_value = 0
40 | for i in results:
41 | #tempInt=int(i[0])
42 | #print tempInt
43 | print i[0]
44 | insert_value = i[0]
45 | #table.write(x,y,i[0])
46 | #excel_create('table1', i[0], x, y)
47 | if insert_value != 0:
48 | rb = open_workbook('first.xls')
49 | wb = copy(rb)
50 | sheet = wb.get_sheet(0)
51 | sheet.write(x, y, insert_value)
52 | wb.save('first.xls')
53 | else:
54 | print "null"
55 |
--------------------------------------------------------------------------------
/analy/transfer.py:
--------------------------------------------------------------------------------
1 | # coding:utf8
2 | import sys
3 | import xlwt
4 | import MySQLdb
5 | reload(sys)
6 | sys.setdefaultencoding('utf8')
7 |
8 | def export_mysqltable_xls(choice):
9 | conn = MySQLdb.connect('localhost','root','yourpassword','dianpingshop',charset='utf8')
10 | cursor = conn.cursor()
11 | global tablename
12 | if choice == 1:
13 | count = cursor.execute('select * from dianpingshop')
14 | tablename = 'dianpingshop'
15 | elif choice == 2:
16 | count = cursor.execute('select * from pagecomment')
17 | elif choice == 3:
18 | count = cursor.execute('select * from user')
19 | elif choice == 4:
20 | count = cursor.execute('select * from user_shop')
21 | else:
22 | count = cursor.execute('select * from yangzhoushop')
23 |
24 | print count
25 |
26 | cursor.scroll(0,mode='absolute')
27 | results = cursor.fetchall()
28 |
29 | fields = cursor.description
30 | workbook = xlwt.Workbook()
31 | sheet = workbook.add_sheet('content',cell_overwrite_ok=True)
32 |
33 | for field in range(0,len(fields)):
34 | sheet.write(0,field,fields[field][0])
35 |
36 | row = 1
37 | col = 0
38 | for row in range(1,len(results)+1):
39 | for col in range(0,len(fields)):
40 | sheet.write(row,col,u'%s'%results[row-1][col])
41 | if choice == 1:
42 | workbook.save(r'./dianpingshop.xls')
43 | elif choice ==2:
44 | workbook.save(r'./pagecomment.xls')
45 | elif choice ==3:
46 | workbook.save(r'./user.xls')
47 | elif choice == 4:
48 | workbook.save(r'./user_listshop.xls')
49 | else:
50 | workbook.save(r'./yangzhoushop.xls')
51 |
52 | if __name__ == '__main__':
53 | print "Enter 1 to export dianpingshop"
54 | print "Enter 2 to export pagecomment"
55 | print "Enter 3 to export user"
56 | print "Enter 4 to export user_listshop"
57 | print "Enter 5 to export yangzhoushop"
58 | print "Or enter 6 to export all tables"
59 | print "Enter your choice:"
60 | choice = int(raw_input("Input your choice:"))
61 | if choice == 1:
62 | export_mysqltable_xls(1)
63 | elif choice == 2:
64 | export_mysqltable_xls(2)
65 | elif choice == 3:
66 | export_mysqltable_xls(3)
67 | elif choice == 4:
68 | export_mysqltable_xls(4)
69 | elif choice == 5:
70 | export_mysqltable_xls(5)
71 | elif choice ==6 :
72 | export_mysqltable_xls(1)
73 | export_mysqltable_xls(2)
74 | export_mysqltable_xls(3)
75 | export_mysqltable_xls(4)
76 | export_mysqltable_xls(5)
77 |
78 | else:
79 | print "Error!"
80 |
--------------------------------------------------------------------------------
/analy/user_location.py:
--------------------------------------------------------------------------------
1 | #encoding=utf-8
2 | #coding = utf-8
3 |
4 | import matplotlib.pyplot as plt
5 | import time
6 |
7 |
8 |
9 | import MySQLdb
10 |
11 | db = MySQLdb.connect("localhost","root","yourpassword","dianpingshop",charset='utf8' )
12 |
13 | cursor = db.cursor()
14 | cursor.execute("select city, count(*) from user group by city order by count(*) desc;")
15 | data = cursor.fetchall()
16 | #print "Database version : %s " % data
17 | for city in data:
18 | if city[1] > 10:
19 | tempcity = city[0]
20 | print tempcity + "%s" % (city[1])
21 |
22 |
23 | #
24 | db.close()
25 | time.sleep(3)
26 |
27 | # The slices will be ordered and plotted counter-clockwise.
28 | labels = u'扬州', u'上海', u'南京', u'苏州', u'北京', u'其它'
29 | sizes = [53, 23, 7, 2, 2, 13]
30 | colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral', 'magenta', 'cyan']
31 | explode = (0, 0.1, 0, 0, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs')
32 |
33 | plt.pie(sizes, explode=explode, labels=labels, colors=colors,
34 | autopct='%1.1f%%', shadow=True, startangle=90)
35 | # Set aspect ratio to be equal so that pie is drawn as a circle.
36 | plt.axis('equal')
37 | plt.title(u'用户分布图')
38 | plt.show()
39 |
--------------------------------------------------------------------------------
/analy/user_table_shop.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding: utf-8
3 |
4 | import xlwt
5 | import xlrd
6 | from xlutils.copy import copy
7 | import MySQLdb.cursors
8 |
9 | def excel_create(sheet, value, x, y):
10 | data = xlwt.Workbook()
11 | table = data.add_sheet(sheet)
12 | print x
13 | print y
14 | table.write(x,y,value)
15 | data.save('demo.xls')
16 |
17 | def excel_read(doc,table,x,y):
18 | data = xlrd.open_workbook(doc)
19 | table = data.sheet_by_name(table)
20 | return table.cell(x,y).value
21 |
22 |
23 | if __name__ == '__main__':
24 | #excel_create('',2)
25 | #x = excel_read('/home/bsns/Music/add/demo.xls','haha',1,4)
26 | #print x
27 | #excel_create('first', 99, 1, 1)
28 | conn = MySQLdb.connect(user='root', passwd='yourpassword', db='dianpingshop', host='localhost', charset="utf8", use_unicode=True)
29 | cursor = conn.cursor()
30 | cursor.execute('SELECT _id FROM user_table_shop;')
31 | rows = cursor.fetchall()
32 | i = 1
33 | file = xlwt.Workbook()
34 | table = file.add_sheet('table1',cell_overwrite_ok=True)
35 | table.col(0).width = 11 * 256 + 182
36 | for row in rows:
37 | if row:
38 | print row[0]
39 | #excel_create('first', row[0], 0, i)
40 | table.write(0,i,row[0])
41 | i = i + 1
42 | #temp = row[0]
43 | #print row
44 | file.save('first.xls')
45 |
46 | cursor.close()
47 |
48 | cursor = conn.cursor()
49 | cursor.execute('SELECT shopurl FROM user_shop group by shopurl;')
50 | print "38================"
51 | rows = cursor.fetchall()
52 | j = 1
53 | #file = xlwt.Workbook()
54 | #table = file.add_sheet('sheet name',cell_overwrite_ok=True)
55 | for row in rows:
56 | if row:
57 | print row[0]
58 | #temp = filter(lambda ch: ch in '0123456789', row[0])
59 | #print temp
60 | #excel_create('first', row[0], 0, i)
61 | table.write(j,0,row[0])
62 | j = j + 1
63 | #temp = row[0]
64 | #print row
65 | file.save('first.xls')
66 |
67 | cursor.close()
68 |
--------------------------------------------------------------------------------
/analy/yz.py:
--------------------------------------------------------------------------------
1 | #coding:utf-8
2 | import matplotlib.pyplot as plt
3 | plt.rcParams['font.sans-serif'] = ['SimSun']
4 | plt.rcParams['axes.unicode_minus'] = False
5 |
6 | mean_values = [39, 35, 21, 15, 331, 31, 25, 6, 22, 22, 24, 16, 72, 10, 36]
7 | variance = [0.2, 0.4, 0.5, 0.2, 0.4, 0.2, 0.4, 0.5, 0.2, 0.4, 0.2, 0.4, 0.5, 0.2, 0.4]
8 | bar_labels = [u'三盛广场', u'京华城', u'扬子江路', u'扬州大学', u'邗江区', u'文汇西路', u'望月路', u'来鹤台广场', u'梅岭', u'汊河汇金谷', u'汽车西站', u'沃尔玛', u'瘦西湖', u'秋雨路', u'其它']
9 | x_pos = list(range(len(bar_labels)))
10 | plt.bar(x_pos, mean_values, yerr=variance, align='center', alpha=0.5)
11 |
12 | plt.grid()
13 |
14 | max_y = max(zip(mean_values, variance)) # returns a tuple, here: (3, 5)
15 | plt.ylim([0, (max_y[0] + max_y[1]) * 1.1])
16 |
17 | plt.ylabel('variable y')
18 | plt.xticks(x_pos, bar_labels)
19 | plt.title(u'扬州')
20 |
21 | plt.show()
22 | #plt.savefig('./my_plot.png')
23 |
--------------------------------------------------------------------------------
/dianping/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/dianping/__init__.py
--------------------------------------------------------------------------------
/dianping/__init__.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/dianping/__init__.pyc
--------------------------------------------------------------------------------
/dianping/dbhelper.py:
--------------------------------------------------------------------------------
1 | import MySQLdb
2 | from scrapy.utils.project import get_project_settings
3 |
4 | class DBHelper():
5 | def __init__(self):
6 | self.settings=get_project_settings() #获取settings配置,设置需要的信息
7 |
8 | self.host=self.settings['MYSQL_HOST']
9 | self.port=self.settings['MYSQL_PORT']
10 | self.user=self.settings['MYSQL_USER']
11 | self.passwd=self.settings['MYSQL_PASSWD']
12 | self.db=self.settings['MYSQL_DBNAME']
13 |
14 | def connectMysql(self):
15 | conn=MySQLdb.connect(host=self.host,
16 | port=self.port,
17 | user=self.user,
18 | passwd=self.passwd,
19 | #db=self.db,不指定数据库名
20 | charset='utf8') #要指定编码,否则中文可能乱码
21 | return conn
22 |
23 | #连接到具体的数据库(settings中设置的MYSQL_DBNAME)
24 | def connectDatabase(self):
25 | conn=MySQLdb.connect(host=self.host,
26 | port=self.port,
27 | user=self.user,
28 | passwd=self.passwd,
29 | db=self.db,
30 | charset='utf8') #要指定编码,否则中文可能乱码
31 | return conn
32 |
33 | #创建数据库
34 | def createDatabase(self):
35 | '''因为创建数据库直接修改settings中的配置MYSQL_DBNAME即可,所以就不要传sql语句了'''
36 | conn=self.connectMysql()#连接数据库
37 |
38 | sql="create database if not exists "+self.db
39 | cur=conn.cursor()
40 | cur.execute(sql)#执行sql语句
41 | cur.close()
42 | conn.close()
43 |
44 | def createTable(self, sql):
45 | conn = self.connectDatabase()
46 |
47 | cur = conn.cursor()
48 | cur.execute(sql)
49 | cur.close()
50 | conn.close()
51 |
52 | # 插入数据
53 | def insert(self, sql, *params): # 注意这里params要加*,因为传递过来的是元组,*表示参数个数不定
54 | conn = self.connectDatabase()
55 |
56 | cur = conn.cursor();
57 | cur.execute(sql, params)
58 | conn.commit() # 注意要commit
59 | cur.close()
60 | conn.close()
61 |
62 | # 更新数据
63 | def update(self, sql, *params):
64 | conn = self.connectDatabase()
65 |
66 | cur = conn.cursor()
67 | cur.execute(sql, params)
68 | conn.commit() # 注意要commit
69 | cur.close()
70 | conn.close()
71 |
72 | # 删除数据
73 | def delete(self, sql, *params):
74 | conn = self.connectDatabase()
75 |
76 | cur = conn.cursor()
77 | cur.execute(sql, params)
78 | conn.commit()
79 | cur.close()
80 | conn.close()
81 |
82 |
83 | '''测试DBHelper的类'''
84 |
85 |
86 | class TestDBHelper():
87 | def __init__(self):
88 | self.dbHelper = DBHelper()
89 |
90 | # 测试创建数据库(settings配置文件中的MYSQL_DBNAME,直接修改settings配置文件即可)
91 | def testCreateDatebase(self):
92 | self.dbHelper.createDatabase()
93 | # 测试创建表
94 |
95 | def testCreateTable(self):
96 | sql = "create table testtable(id int primary key auto_increment,name varchar(50),url varchar(200))"
97 | self.dbHelper.createTable(sql)
98 |
99 | # 测试插入
100 | def testInsert(self):
101 | sql = "insert into testtable(name,url) values(%s,%s)"
102 | params = ("test", "test")
103 | self.dbHelper.insert(sql, *params) # *表示拆分元组,调用insert(*params)会重组成元组
104 |
105 | def testUpdate(self):
106 | sql = "update testtable set name=%s,url=%s where id=%s"
107 | params = ("update", "update", "1")
108 | self.dbHelper.update(sql, *params)
109 |
110 | def testDelete(self):
111 | sql = "delete from testtable where id=%s"
112 | params = ("1")
113 | self.dbHelper.delete(sql, *params)
114 |
115 |
116 | if __name__ == "__main__":
117 | testDBHelper = TestDBHelper()
118 |
--------------------------------------------------------------------------------
/dianping/items.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # Define here the models for your scraped items
4 | #
5 | # See documentation in:
6 | # http://doc.scrapy.org/en/latest/topics/items.html
7 |
8 | from scrapy import Field,Item
9 | import scrapy
10 |
11 |
12 | #class DianpingItem(scrapy.Item):
13 | # define the fields for your item here like:
14 | # name = scrapy.Field()
15 | # pass
16 | class DianpingItem(Item):
17 | shopname = Field()
18 | shoplevel = Field()
19 | shopurl = Field()
20 | reviewnum = Field()
21 | avgcost = Field()
22 | taste = Field()
23 | env = Field()
24 | service = Field()
25 | foodtype = Field()
26 | location = Field()
27 |
28 | class CommentItem(scrapy.Item):
29 | _id = scrapy.Field()
30 | shop_id = scrapy.Field()
31 | user_id = scrapy.Field()
32 | user_name = scrapy.Field()
33 | stars = scrapy.Field()
34 | label_1 = scrapy.Field()
35 | label_2 = scrapy.Field()
36 | label_3 = scrapy.Field()
37 | content = scrapy.Field()
38 | avg_cost = scrapy.Field()
39 | likes = scrapy.Field()
40 |
41 | class UserItem(scrapy.Item):
42 | _id = scrapy.Field()
43 | user_name = scrapy.Field()
44 | is_vip = scrapy.Field()
45 | contribution = scrapy.Field()
46 | birthday = scrapy.Field()
47 | city = scrapy.Field()
48 | gender = scrapy.Field()
49 |
50 | #class User_shopItem(scrapy.Item):
51 | # shopname = scrapy.Field()
52 | # shopurl = scrapy.Field()
53 | # shoplevel = scrapy.Field()
54 |
55 | class User_shopItem(scrapy.Item):
56 | shopname = scrapy.Field()
57 | shopurl = scrapy.Field()
58 | shoplevel = scrapy.Field()
59 | _id = scrapy.Field()
60 |
--------------------------------------------------------------------------------
/dianping/items.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/dianping/items.pyc
--------------------------------------------------------------------------------
/dianping/middlewares.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # Define here the models for your spider middleware
4 | #
5 | # See documentation in:
6 | # http://doc.scrapy.org/en/latest/topics/spider-middleware.html
7 |
8 | from scrapy import signals
9 |
10 |
11 | class DianpingSpiderMiddleware(object):
12 | # Not all methods need to be defined. If a method is not defined,
13 | # scrapy acts as if the spider middleware does not modify the
14 | # passed objects.
15 |
16 | @classmethod
17 | def from_crawler(cls, crawler):
18 | # This method is used by Scrapy to create your spiders.
19 | s = cls()
20 | crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
21 | return s
22 |
23 | def process_spider_input(response, spider):
24 | # Called for each response that goes through the spider
25 | # middleware and into the spider.
26 |
27 | # Should return None or raise an exception.
28 | return None
29 |
30 | def process_spider_output(response, result, spider):
31 | # Called with the results returned from the Spider, after
32 | # it has processed the response.
33 |
34 | # Must return an iterable of Request, dict or Item objects.
35 | for i in result:
36 | yield i
37 |
38 | def process_spider_exception(response, exception, spider):
39 | # Called when a spider or process_spider_input() method
40 | # (from other spider middleware) raises an exception.
41 |
42 | # Should return either None or an iterable of Response, dict
43 | # or Item objects.
44 | pass
45 |
46 | def process_start_requests(start_requests, spider):
47 | # Called with the start requests of the spider, and works
48 | # similarly to the process_spider_output() method, except
49 | # that it doesn’t have a response associated.
50 |
51 | # Must return only requests (not items).
52 | for r in start_requests:
53 | yield r
54 |
55 | def spider_opened(self, spider):
56 | spider.logger.info('Spider opened: %s' % spider.name)
57 |
--------------------------------------------------------------------------------
/dianping/pipelines.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # Define your item pipelines here
4 | #
5 | # Don't forget to add your pipeline to the ITEM_PIPELINES setting
6 | # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
7 | from twisted.enterprise import adbapi
8 | import MySQLdb
9 | import MySQLdb.cursors
10 | import codecs
11 | import json
12 | from scrapy import Field,Item
13 | import scrapy
14 | from items import DianpingItem
15 | from items import CommentItem
16 | from items import UserItem
17 | from dianping.items import User_shopItem
18 |
19 |
20 |
21 |
22 | class JsonWithEncodingPipeline(object):
23 | def __init__(self):
24 | self.file = codecs.open('info.json', 'w', encoding='utf-8')#保存为json文件
25 | def process_item(self, item, spider):
26 | line = json.dumps(dict(item)) + "\n"#转为json的
27 | self.file.write(line)#写入文件中
28 | return item
29 | def spider_closed(self, spider):#爬虫结束时关闭文件
30 | self.file.close()
31 |
32 | class DianpingPipeline(object):
33 | #def process_item(self, item, spider):
34 | # return item
35 |
36 | def __init__(self,dbpool):
37 | self.dbpool=dbpool
38 |
39 | @classmethod
40 | def from_settings(cls,settings):
41 | dbparams=dict(
42 | host=settings['MYSQL_HOST'],#读取settings中的配置
43 | db=settings['MYSQL_DBNAME'],
44 | user=settings['MYSQL_USER'],
45 | passwd=settings['MYSQL_PASSWD'],
46 | charset='utf8',#编码要加上,否则可能出现中文乱码问题
47 | cursorclass=MySQLdb.cursors.DictCursor,
48 | use_unicode=False,
49 | )
50 | dbpool=adbapi.ConnectionPool('MySQLdb',**dbparams)#**表示将字典扩展为关键字参数,相当于host=xxx,db=yyy....
51 | return cls(dbpool)#相当于dbpool付给了这个类,self中可以得到
52 |
53 |
54 | def process_item(self, item, spider):
55 | if isinstance(item, DianpingItem):
56 | query=self.dbpool.runInteraction(self._conditional_insert,item)#调用插入的方法
57 | query.addErrback(self._handle_error,item,spider)#调用异常处理方法
58 | elif isinstance(item, User_shopItem):
59 | query=self.dbpool.runInteraction(self._conditional_insert_User_shopItem,item)#调用插入的方法
60 | query.addErrback(self._handle_error,item,spider)
61 | print item
62 | print 'User_shopItem'
63 | #if isinstance(item, UserItem):
64 | # query=self.dbpool.runInteraction(self._conditional_insert_User,item)#调用插入的方法
65 | # query.addErrback(self._handle_error,item,spider)
66 | # print item
67 | # print 'itemuser'
68 | #if isinstance(item, User_shopItem):
69 | # query=self.dbpool.runInteraction(self._conditional_insert_User_shopItem,item)#调用插入的方法
70 | # query.addErrback(self._handle_error,item,spider)
71 | # print item
72 | # print 'User_shopItem'
73 | elif spider.name == 'comment':
74 | str1 = type(item)
75 | if str(str1) == "":
76 | query=self.dbpool.runInteraction(self._conditional_insert_Comment,item)#调用插入的方法
77 | query.addErrback(self._handle_error,item,spider)
78 |
79 | else:
80 | query=self.dbpool.runInteraction(self._conditional_insert_User,item)#调用插入的方法
81 | query.addErrback(self._handle_error,item,spider)
82 |
83 |
84 | return item
85 |
86 |
87 | def _conditional_insert(self, tx, item):
88 |
89 | sql = "insert into yangzhoushop(shopname,shoplevel,shopurl,reviewnum,avgcost,taste,env,service,foodtype,location) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
90 | params = (item['shopname'], item['shoplevel'], item['shopurl'], item['reviewnum'],item['avgcost'],item['taste'],item['env'],item['service'],item['foodtype'],item['location'])
91 | tx.execute(sql, params)
92 | def _conditional_insert_User(self, tx, item):
93 | sql = "insert into user(city,gender,birthday,is_vip,contribution,_id,user_name) values(%s,%s,%s,%s,%s,%s,%s)"
94 | params = (item['city'], item['gender'], item['birthday'], item['is_vip'], item['contribution'], item['_id'], item['user_name'])
95 | tx.execute(sql, params)
96 | # def _conditional_insert_Comment(self, tx, item):
97 | # sql = "insert into pagecomment(content,user_id,stars,avg_cost,shop_id,label_1,label_2,label_3,_id,user_name,likes) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
98 | # params = (item['content'], item['user_id'], item['stars'], item['avg_cost'], item['shop_id'], item['label_1'], item['label_2'], item['label_3'], item['_id'], item['user_name'], item['likes'])
99 | # tx.execute(sql, params)
100 | def _conditional_insert_Comment(self, tx, item):
101 | try:
102 | #sql = "insert into pagecomment(content,user_id,stars,avg_cost,shop_id,label_1,label_2,label_3,_id,user_name,likes) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
103 | #params = (item['content'], item['user_id'], item['stars'], item['avg_cost'], item['shop_id'], item['label_1'], item['label_2'], item['label_3'], item['_id'], item['user_name'], item['likes'])
104 | sql = "insert into pagecomment(content,user_id,stars,avg_cost,shop_id,label_1,label_2,label_3,_id,user_name) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
105 | params = (item['content'], item['user_id'], item['stars'], item['avg_cost'], item['shop_id'], item['label_1'], item['label_2'], item['label_3'], item['_id'], item['user_name'])
106 | tx.execute(sql, params)
107 | #self.conn.commit()
108 | except MySQLdb.Error, e:
109 | print "Error %d: %s" % (e.args[0], e.args[1])
110 | #return item
111 | def _conditional_insert_User_shopItem(self, tx, item):
112 | sql = "insert into user_shop(shopname,shopurl,shoplevel,_id) values(%s,%s,%s,%s)"
113 | params = (item['shopname'], item['shopurl'], item['shoplevel'], item['_id'])
114 | tx.execute(sql, params)
115 |
116 | def _handle_error(self, failue, item, spider):
117 | print failue
118 |
--------------------------------------------------------------------------------
/dianping/pipelines.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/dianping/pipelines.pyc
--------------------------------------------------------------------------------
/dianping/settings.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # Scrapy settings for dianping project
4 | #
5 | # For simplicity, this file contains only settings considered important or
6 | # commonly used. You can find more settings consulting the documentation:
7 | #
8 | # http://doc.scrapy.org/en/latest/topics/settings.html
9 | # http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html
10 | # http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html
11 |
12 | BOT_NAME = 'dianping'
13 |
14 | SPIDER_MODULES = ['dianping.spiders']
15 | NEWSPIDER_MODULE = 'dianping.spiders'
16 |
17 | #ROBOTSTXT_OBEY = True
18 | # Crawl responsibly by identifying yourself (and your website) on the user-agent
19 | #USER_AGENT = 'dianping (+http://www.yourdomain.com)'
20 |
21 | USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.54 Safari/536.5'
22 |
23 | # Obey robots.txt rules
24 |
25 | ROBOTSTXT_OBEY=False
26 | DOWNLOAD_DELAY = 3
27 |
28 | # Configure maximum concurrent requests performed by Scrapy (default: 16)
29 | #CONCURRENT_REQUESTS = 32
30 |
31 | # Configure a delay for requests for the same website (default: 0)
32 | # See http://scrapy.readthedocs.org/en/latest/topics/settings.html#download-delay
33 | # See also autothrottle settings and docs
34 | #DOWNLOAD_DELAY = 3
35 | # The download delay setting will honor only one of:
36 | #CONCURRENT_REQUESTS_PER_DOMAIN = 16
37 | #CONCURRENT_REQUESTS_PER_IP = 16
38 |
39 | # Disable cookies (enabled by default)
40 | #COOKIES_ENABLED = False
41 |
42 | # Disable Telnet Console (enabled by default)
43 | #TELNETCONSOLE_ENABLED = False
44 |
45 | # Override the default request headers:
46 | #DEFAULT_REQUEST_HEADERS = {
47 | # 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
48 | # 'Accept-Language': 'en',
49 | #}
50 |
51 | # Enable or disable spider middlewares
52 | # See http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html
53 | #SPIDER_MIDDLEWARES = {
54 | # 'dianping.middlewares.DianpingSpiderMiddleware': 543,
55 | #}
56 |
57 | # Enable or disable downloader middlewares
58 | # See http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html
59 | #DOWNLOADER_MIDDLEWARES = {
60 | # 'dianping.middlewares.MyCustomDownloaderMiddleware': 543,
61 | #}
62 |
63 | # Enable or disable extensions
64 | # See http://scrapy.readthedocs.org/en/latest/topics/extensions.html
65 | #EXTENSIONS = {
66 | # 'scrapy.extensions.telnet.TelnetConsole': None,
67 | #}
68 |
69 | # Configure item pipelines
70 | # See http://scrapy.readthedocs.org/en/latest/topics/item-pipeline.html
71 | #ITEM_PIPELINES = {
72 | # 'dianping.pipelines.DianpingPipeline': 300,
73 | #}
74 |
75 | # Enable and configure the AutoThrottle extension (disabled by default)
76 | # See http://doc.scrapy.org/en/latest/topics/autothrottle.html
77 | #AUTOTHROTTLE_ENABLED = True
78 | # The initial download delay
79 | #AUTOTHROTTLE_START_DELAY = 5
80 | # The maximum download delay to be set in case of high latencies
81 | #AUTOTHROTTLE_MAX_DELAY = 60
82 | # The average number of requests Scrapy should be sending in parallel to
83 | # each remote server
84 | #AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
85 | # Enable showing throttling stats for every response received:
86 | #AUTOTHROTTLE_DEBUG = False
87 |
88 | # Enable and configure HTTP caching (disabled by default)
89 | # See http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
90 | #HTTPCACHE_ENABLED = True
91 | #HTTPCACHE_EXPIRATION_SECS = 0
92 | #HTTPCACHE_DIR = 'httpcache'
93 | #HTTPCACHE_IGNORE_HTTP_CODES = []
94 | #HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'
95 |
96 | ITEM_PIPELINES = {
97 | 'dianping.pipelines.DianpingPipeline': 300,#保存到mysql数据库
98 | 'dianping.pipelines.JsonWithEncodingPipeline': 300,#保存到文件中
99 | }
100 |
101 | #Mysql数据库的配置信息
102 | MYSQL_HOST = '127.0.0.1'
103 | MYSQL_DBNAME = 'dianpingshop' #数据库名字,请修改
104 | MYSQL_USER = 'root' #数据库账号,请修改
105 | MYSQL_PASSWD = 'yourpassword' #数据库密码,请修改
106 |
107 | MYSQL_PORT = 3306 #数据库端口,在dbhelper中使用
108 |
109 |
110 | FEED_EXPORT_ENCODING = 'utf-8'
111 | HTTPERROR_ALLOWED_CODES = [403]
112 |
--------------------------------------------------------------------------------
/dianping/settings.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/dianping/settings.pyc
--------------------------------------------------------------------------------
/dianping/spiders/__init__.py:
--------------------------------------------------------------------------------
1 | # This package will contain the spiders of your Scrapy project
2 | #
3 | # Please refer to the documentation for information on how to create and manage
4 | # your spiders.
5 |
--------------------------------------------------------------------------------
/dianping/spiders/__init__.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/dianping/spiders/__init__.pyc
--------------------------------------------------------------------------------
/dianping/spiders/comment.py:
--------------------------------------------------------------------------------
1 | # coding:utf-8
2 | import scrapy
3 | import urllib2
4 | import urllib
5 | from bs4 import BeautifulSoup
6 | import urlparse
7 | from scrapy.http import Request
8 | from scrapy.http import Response
9 | from dianping.items import CommentItem
10 | from dianping.items import UserItem
11 | import re
12 | import time
13 | from scrapy.conf import settings
14 | import MySQLdb
15 | import MySQLdb.cursors
16 |
17 |
18 | class CommentSpider(scrapy.Spider):
19 |
20 | name = "comment"
21 | shop_urls = []
22 | cnt = 0
23 | page = 1
24 | user_home = 'http://www.dianping.com/member/'
25 | urls = []
26 | start_urls = []
27 |
28 | def __init__(self):
29 | conn = MySQLdb.connect(host="localhost",user="root",passwd="yourpassword",db="dianpingshop",charset="utf8")
30 | cursor = conn.cursor()
31 |
32 | cursor.execute("select shopurl from dianpingshop")
33 |
34 |
35 | urls = []
36 | shop_urls = []
37 | elems = cursor.fetchall()
38 | #for elem in cursor.fetchall():
39 | for elem in elems:
40 | #print elem
41 | for r in elem:
42 | print(r)
43 |
44 |
45 | str = r + '/review_more'
46 | print 'caling here++++' + str
47 | #yield self.make_requests_from_url(r[0])
48 | shop_urls.append(str)
49 | urls.append(str)
50 |
51 | #self.start_urls.append(urls[0])
52 | self.start_urls.append(urls[0])
53 | self.urls = urls[1:]
54 | self.shop_urls = shop_urls
55 | #yield scrapy.Request(str, callback=self.parse_item)
56 | #conn.commit()
57 | cursor.close()
58 | conn.close()
59 | #connection.close()
60 |
61 | def deal_num(self, str):
62 | ans = ''
63 | num = 0
64 | for ch in str:
65 | try:
66 | int(ch)
67 | num *= 10
68 | num += int(ch)
69 | break
70 | except:
71 | ans += ch
72 |
73 | return [ans, num]
74 |
75 |
76 | def user(self, response):
77 | temp = response.body
78 | soup = BeautifulSoup(temp, from_encoding='utf-8')
79 | item = UserItem()
80 | str1 = response.url
81 |
82 | id = ''
83 | for ch in str1:
84 | try:
85 | int(ch)
86 | id += ch
87 | except:
88 | pass
89 |
90 | item['_id'] = id
91 |
92 | txt = soup.find('div', class_='txt')
93 | item['user_name'] = txt.find('h2', class_='name').get_text().encode('utf-8')
94 | item['is_vip'] = 0
95 | try:
96 | vip = txt.find('div', class_='vip').find('i',class_='icon-vip')
97 | if vip != None:
98 | item['is_vip'] = 1
99 | except:
100 | pass
101 |
102 | col_exp = txt.find('div', class_='col-exp')
103 | rank = col_exp.find('span', class_='user-rank-rst')['title']
104 | num = 0
105 | for ch in rank:
106 | try:
107 | int(ch)
108 | num *= 10
109 | num += int(ch)
110 | except:
111 | pass
112 |
113 | item['contribution'] = num
114 |
115 | try:
116 | item['gender'] = col_exp.find('span', class_='user-groun').find('i')['class'][0]
117 | except:
118 | item['gender'] = ''
119 |
120 | try:
121 | item['city'] = col_exp.find('span', class_='user-groun').get_text()
122 | except:
123 | item['city'] = ''
124 |
125 | try:
126 | msg = soup.find('div', class_='aside').find('div', class_='user-message').find('ul').find_all('li')[1].get_text()
127 | item['birthday'] = msg[3:]
128 | except:
129 | item['birthday'] = ''
130 |
131 | yield item
132 |
133 |
134 | def parse(self, response):
135 | str = response.url
136 | temp = response.body
137 | soup = BeautifulSoup(temp,"lxml", from_encoding='utf-8')
138 | item = CommentItem()
139 |
140 | try:
141 | id = ''
142 | for ch in str:
143 | if ch == '?':
144 | break
145 | try:
146 | int(ch)
147 | id += ch
148 | except:
149 | pass
150 |
151 |
152 |
153 | comment_mode = soup.find('div', class_='comment-mode')
154 | lists = comment_mode.find('div', class_='comment-list').find('ul').find_all('li')
155 | new_list = []
156 | for li in lists:
157 | try:
158 | li['data-id']
159 | new_list.append(li)
160 | except:
161 | pass
162 |
163 | for li in new_list:
164 |
165 |
166 | item['shop_id'] = id
167 | item['_id'] = li['data-id']
168 | try:
169 | item['user_id'] = li.find('a', class_='J_card')['user-id']
170 | except:
171 | item['user_id'] = ''
172 |
173 | home = self.user_home + item['user_id']
174 | yield Request(home, callback=self.user)
175 |
176 | try:
177 | item['user_name'] = li.find('p', class_='name').find('a').get_text().encode('utf-8')
178 | except:
179 | item['user_name'] = ''
180 |
181 |
182 | content = li.find('div', class_='content')
183 | user_info = content.find('div', class_='user-info')
184 | try:
185 | stars = user_info.find('span', class_='item-rank-rst')['class']
186 | tp = self.deal_num(stars[1])
187 | item['stars'] = tp[1]
188 | except:
189 | item['stars'] = ''
190 |
191 | try:
192 | rsts = user_info.find('div', class_='comment-rst').find_all('span', class_='rst')
193 | #temp = site.xpath('//div[2]/div[1]/div/span[1]').extract()
194 | tp = self.deal_num(rsts[0].get_text().encode('utf-8'))
195 |
196 | item['label_1'] = tp[-1]
197 | #item['label_1'] = dict()
198 | #item['label_1'][tp[0]] = tp[-1]
199 |
200 | tp = self.deal_num(rsts[1].get_text().encode('utf-8'))
201 | #item['label_2'] = dict()
202 | #item['label_2'][tp[0]] = tp[1]
203 | item['label_2'] = tp[-1]
204 |
205 | tp = self.deal_num(rsts[2].get_text().encode('utf-8'))
206 | #item['label_3'] = dict()
207 | #item['label_3'][tp[0]] = tp[1]
208 | item['label_3'] = tp[-1]
209 | except:
210 | item['label_1'] = ''
211 | item['label_2'] = ''
212 | item['label_3'] = ''
213 |
214 | item['avg_cost'] = ''
215 | try:
216 | cost = user_info.find('span', class_='comm-per').get_text()
217 | num = 0
218 | for ch in cost:
219 | try:
220 | int(ch)
221 | num *= 10
222 | num += int(ch)
223 | except:
224 | pass
225 |
226 | item['avg_cost'] = int(num)
227 | except:
228 | pass
229 |
230 | cont = content.find('div', class_='comment-txt').find('div', class_='J_brief-cont').get_text().strip()
231 | item['content'] = cont
232 |
233 | item['likes'] = []
234 | try:
235 | dishes = content.find('div', class_='comment-recommend').find_all('a', class_='col-exp')
236 | for dish in dishes:
237 | item['likes'].append(dish.get_text().encode('utf-8'))
238 |
239 | except:
240 | pass
241 |
242 |
243 | yield item
244 |
245 |
246 | print 'page: ', self.page
247 | self.page += 1
248 | try:
249 |
250 | next_page = soup.find('div', class_ = 'Pages').find('a', class_ = 'NextPage')
251 | url = self.shop_urls[self.cnt] + next_page['href']
252 | print 'turn page to: ' + url
253 | yield Request(url)
254 | except:
255 | # print '-------: ' + self.urls[self.cnt + 1]
256 | self.page = 1
257 | try:
258 | time.sleep(1)
259 | yield Request(self.urls[self.cnt])
260 | self.cnt += 1
261 | except:
262 | pass
263 | except:
264 | print 'oh, page error'
265 | time.sleep(1)
266 | yield Request(str, dont_filter=True)
267 | # pass
268 |
--------------------------------------------------------------------------------
/dianping/spiders/comment.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/dianping/spiders/comment.pyc
--------------------------------------------------------------------------------
/dianping/spiders/dianpingspider.py:
--------------------------------------------------------------------------------
1 | #coding=utf-8
2 | # -*- coding : utf-8-*-
3 | #! python3
4 | from dianping.items import DianpingItem
5 | from scrapy.spiders import Spider
6 | from scrapy.selector import Selector
7 | from scrapy import Request
8 | import sys
9 |
10 |
11 | reload(sys)
12 | sys.setdefaultencoding('utf-8')
13 |
14 | class dianpingspider(Spider):
15 | name = 'dianping'
16 | allowed_domains = ['www.dianping.com']
17 |
18 | headers = {
19 | 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36',
20 | }
21 |
22 | # start_urls=[
23 | # 'http://www.dianping.com/search/category/12/10'
24 | # ]
25 | #def parse(self, response):
26 | # filename = response.url.split("/")[-2]
27 | # open(filename, 'wb').write(response.body)
28 |
29 | def start_requests(self):
30 | url = 'http://www.dianping.com/search/category/12/10/o3'
31 | yield Request(url, headers=self.headers)
32 |
33 | def parse(self, response):
34 | item = DianpingItem()
35 |
36 | sel = Selector(response)
37 | sites = sel.xpath('//div[@id="shop-all-list"]/ul/li')
38 | for site in sites:
39 | title = site.xpath('div[2]/div[1]/a[1]/h4/text()').extract()
40 | item['shopname'] = title[0]
41 | print title[0]
42 |
43 | link = site.xpath('div[2]/div[1]/a[1]/@href').extract()
44 | item['shopurl'] = 'http://www.dianping.com' + str(link[0])
45 | print 'http://www.dianping.com' + str(link[0])
46 |
47 | shoplevels = site.xpath('div[2]/div[2]/span/@title').extract()
48 | item['shoplevel'] = shoplevels[0]
49 |
50 | reviewnums = site.xpath('div[2]/div[2]/a[1]/b/text()').extract()
51 | if len(reviewnums) > 0:
52 | item['reviewnum'] = reviewnums[0]
53 | else:
54 | item['reviewnum'] = '0'
55 |
56 | avgcost = site.xpath('div[2]/div[2]/a[2]/b/text()').extract()
57 | if len(avgcost) > 0:
58 | #item['avgcost'] = avgcost[0]
59 | item['avgcost'] = int(avgcost[0].lstrip('¥'))
60 | else:
61 | item['avgcost'] = '0'
62 |
63 | tastes = site.xpath('div[2]/span/span[1]/b/text()').extract()
64 | if len(tastes) > 0:
65 | item['taste'] = tastes[0]
66 | else:
67 | item['taste'] = '0'
68 |
69 | envs = site.xpath('div[2]/span/span[2]/b/text()').extract()
70 | if len(envs) > 0:
71 | item['env'] = envs[0]
72 | else:
73 | item['env'] = '0'
74 |
75 | services = site.xpath('div[2]/span/span[3]/b/text()').extract()
76 | if len(services) > 0:
77 | item['service'] = services[0]
78 | else:
79 | item['service'] = '0'
80 |
81 | foodtypes = site.xpath('div[2]/div[3]/a[1]/span/text()').extract()
82 | item['foodtype'] = foodtypes[0]
83 |
84 | location = site.xpath('div[2]/div[3]/a[2]/span/text()').extract()
85 | item['location'] = location[0]
86 |
87 | yield item
88 |
89 | nextLink = site.xpath('//div[@class="page"]/a[last()]/@data-ga-page').extract()
90 | print '++++++++++++++++++++++++++++++++++++++++++++++'
91 | print nextLink
92 |
93 | if nextLink:
94 | print nextLink[0]
95 | nextLink = 'http://www.dianping.com/search/category/12/10/o3p' + nextLink[0]
96 | #reallink = str(response.url)
97 | print nextLink
98 | #reallink = nextLink
99 | yield Request(nextLink, headers=self.headers)
100 |
--------------------------------------------------------------------------------
/dianping/spiders/dianpingspider.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/dianping/spiders/dianpingspider.pyc
--------------------------------------------------------------------------------
/dianping/spiders/user.py:
--------------------------------------------------------------------------------
1 | #coding=utf-8
2 | # -*- coding : utf-8-*-
3 |
4 | from dianping.items import User_shopItem
5 | from dianping.items import CommentItem
6 | from scrapy.spiders import Spider
7 | from scrapy.selector import Selector
8 | from scrapy import Request
9 | import sys
10 | import MySQLdb
11 | import MySQLdb.cursors
12 |
13 |
14 | reload(sys)
15 | sys.setdefaultencoding('utf-8')
16 |
17 |
18 | class dianpingspider(Spider):
19 | name = 'user'
20 | allowed_domains = ['www.dianping.com']
21 |
22 | headers = {
23 | 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36',
24 | }
25 |
26 |
27 | def start_requests(self):
28 | conn = MySQLdb.connect(user='root', passwd='yourpassword', db='dianpingshop', host='localhost', charset="utf8", use_unicode=True)
29 | cursor = conn.cursor()
30 | cursor.execute('SELECT _id FROM user;')
31 | print cursor.execute("SELECT _id FROM user")
32 | rows = cursor.fetchall()
33 |
34 | for row in rows:
35 | if row:
36 | print row[0]
37 | #global temp
38 | #temp = row[0]
39 | row = "https://www.dianping.com/member/" + str(row[0]) + "/reviews"
40 | print row
41 | #temp = row
42 | yield Request(row, self.parse, meta=dict(start_url=row))
43 | cursor.close()
44 |
45 |
46 | def parse(self, response):
47 | item = User_shopItem()
48 |
49 | sel = Selector(response)
50 | sites = sel.xpath('//div[@id="J_review"]/div[1]/ul/li')
51 | #print sel.xpath('//div[@id="J_review"]')
52 | for site in sites:
53 | print site
54 | #print site.xpath('//div/div[1]/h6/a/text()').extract()
55 | title = site.xpath('div/div[1]/h6/a/text()').extract()
56 | item['shopname'] = title[0]
57 | print title[0]
58 |
59 | link = site.xpath('//div/div[1]/h6/a/@href').extract()
60 | item['shopurl'] = str(link[0])
61 | print str(link[0])
62 |
63 | shoplevels = site.xpath('//div[1]/ul/li[*]/div/div[2]/div[2]/span').extract()
64 | markup = filter(lambda ch: ch in '0123456789', shoplevels[0])
65 |
66 | #print 'shoplevel=======' + shoplevels[0]
67 | item['shoplevel'] = int(markup)/10
68 |
69 | #temp = filter(lambda ch: ch in '0123456789', response.url)
70 | id = ''
71 | for ch in response.url:
72 | if ch == '?':
73 | break
74 | try:
75 | int(ch)
76 | id += ch
77 | except:
78 | pass
79 | #_id = id
80 | #print "_id====" + temp
81 | item['_id'] = id
82 | yield item
83 |
84 | #print site.xpath('//div[@class="pages-num"]/@page-next/a[last()]/@data-pg').extract()
85 | print response.url
86 | print '++++++++++++++++++++++++++++++++++++++++++++++'
87 |
88 | #print temp
89 | nextLink = site.xpath('//div[@class="pages-num"]/a[last()][@class="page-next"]/@data-pg').extract()
90 |
91 | print nextLink
92 |
93 | if nextLink:
94 | print nextLink[0]
95 | nextLink = response.url + '?pg=' + nextLink[0]
96 | #reallink = str(response.url)
97 | print nextLink
98 | #reallink = nextLink
99 | yield Request(nextLink, headers=self.headers)
100 |
--------------------------------------------------------------------------------
/dianping/spiders/user.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/dianping/spiders/user.pyc
--------------------------------------------------------------------------------
/images/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/1.png
--------------------------------------------------------------------------------
/images/10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/10.png
--------------------------------------------------------------------------------
/images/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/11.png
--------------------------------------------------------------------------------
/images/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/12.png
--------------------------------------------------------------------------------
/images/13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/13.png
--------------------------------------------------------------------------------
/images/14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/14.png
--------------------------------------------------------------------------------
/images/15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/15.png
--------------------------------------------------------------------------------
/images/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/2.png
--------------------------------------------------------------------------------
/images/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/3.png
--------------------------------------------------------------------------------
/images/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/4.png
--------------------------------------------------------------------------------
/images/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/5.png
--------------------------------------------------------------------------------
/images/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/6.png
--------------------------------------------------------------------------------
/images/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/7.png
--------------------------------------------------------------------------------
/images/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/8.png
--------------------------------------------------------------------------------
/images/9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bsns/dianping/35305e33bfb259a6f6dc0609f674e022a4cfcaba/images/9.png
--------------------------------------------------------------------------------
/scrapy.cfg:
--------------------------------------------------------------------------------
1 | # Automatically created by: scrapy startproject
2 | #
3 | # For more information about the [deploy] section see:
4 | # https://scrapyd.readthedocs.org/en/latest/deploy.html
5 |
6 | [settings]
7 | default = dianping.settings
8 |
9 | [deploy]
10 | #url = http://localhost:6800/
11 | project = dianping
12 |
--------------------------------------------------------------------------------