前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >BS1070-基于java+springboot+echarts实现酒店推荐大数据采集清洗数据分析可视化系统

BS1070-基于java+springboot+echarts实现酒店推荐大数据采集清洗数据分析可视化系统

作者头像
计算机程序优异哥
发布2023-09-18 10:26:16
2170
发布2023-09-18 10:26:16
举报
文章被收录于专栏:毕设程序汇总毕设程序汇总

本酒店推荐大数据采集清洗数据分析可视化的设计与实现,系统主要采用java,springboot,动态图表echarts,vue,mysql,mybatisplus,酒店信息数据分析,html,css,javascript等技术实现,主要通过互联网采集爬虫获取互联网酒店信息,对酒店数据进行数据分析整合,数据处理成JSON格式,通过前端javascript解析JSON完成数据可视化的动态展示。

系统采集模块主要包含:数据采集解析,数据过滤,数据清洗,数据入库等操作

系统可视化分析模块主要包含:数据维度及指标的建立,动态图表的构建等等

原文地址

一、程序设计

本基于javaSpringboot的协同过滤推荐算法的酒店信息推荐系统,主要内容涉及:

主要功能模块:数据采集解析,数据过滤,数据清洗,数据入库,系统可视化分析模块主要包含:数据维度及指标的建立,动态图表的构建等等

二、效果实现

演示视频

<iframe style="width:100%;height:500px;" src="//player.bilibili.com/player.html?aid=955652199&bvid=BV1WW4y1f7jr&cid=1191390381&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>

数据可视化

三、代码实现

基于java开发的酒店推荐大数据采集清洗数据分析可视化的系统主要采用前后端模式,针对酒店信息游客数据查询封装成JSON格式,完成数据下发至系统界面端渲染,系统界面端针对JSON解析后采用javascript完成页面展示。其中系统首页酒店信息采集模块采用Python开发爬虫实现,数据采集代码逻辑如下:

代码语言:java
复制
# 批量爬取数据
def getAUrl(urls):
    data_number = 0
    for url in urls:
        getAttractions(url)
        print('抓取地址:{}'.format(url),sep='\n')

# 爬取当页面数据
def getAttractions(url,data = None):
    web_data = requests.get(url)
    time.sleep(2)
    soup = BeautifulSoup(web_data.text,'lxml')
    print(soup)

    hotel_names = soup.select('div.module-body > div > div:nth-child(2) > a:nth-child(2)')
    hotel_images = soup.select('div.module-body > div > div:nth-child(1) img')
    hotel_points = soup.select('div.module-body > div > div:nth-child(2) > div> p:nth-child(2)')
    hotel_introduces = soup.select('div.module-body > div > div:nth-child(2) > p')
    hotel_prices = soup.select('div.module-body > div > div:nth-child(3) div p strong')


    if data == None:
        for name,image,point,introduce,price in \
                zip(hotel_names,hotel_images,hotel_points,hotel_introduces,hotel_prices):
            data = {
                'name':name.get_text().replace('\r\n','').strip(),
                'image':image.get('src'),
                'point':re.findall(r'-?\d+\.?\d*e?-?\d*?', point.get_text())[0],
                'introduce':introduce.get_text().replace('\r\n','').strip(),
                'price':int(price.get_text())
            }
            print(data)
            infos.append(data)

# 根据价格从高到低进行排序
def getInfosByPrice(infos = infos):
    infos = sorted(infos, key=lambda info: info['price'], reverse=True)
    for info in infos:
        print(info['price'], info['name'])

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
作者已关闭评论
0 条评论
热度
最新
推荐阅读
目录
  • 一、程序设计
  • 二、效果实现
    • 演示视频
      • 数据可视化
      • 三、代码实现
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档