# python基于Selenium框架爬取美团酒店数据 **Repository Path**: the_sent/selenium ## Basic Information - **Project Name**: python基于Selenium框架爬取美团酒店数据 - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 7 - **Forks**: 1 - **Created**: 2019-05-28 - **Last Updated**: 2025-03-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # python基于Selenium框架爬取美团酒店数据 #### 介绍 #### 软件架构 开发环境:python3.7 web框架:flask 爬虫裤架:selenium 浏览器:chrome请安装版本 75.0.3770.8(正式版本) (64 位) #### 安装教程 使用pip安装模块即可 1.pip install selenium //安装爬虫框架 2.pip install flask //安装web框架 3.并安装Google浏览器,chrome请安装版本 75.0.3770.8(正式版本) (64 位) 4.将geckodriver.exe放入python的安装路径 5.命令行下打开Google浏览器,输入此命令,然后登陆https://i.meituan.com,让浏览器保存cookie 命令:chrome.exe --remote-debugging-port=9222 --user-data-dir="C:\selenum\AutomationProfile" 6.运行server.py文件,请将getgetromid.py和MAIN放在同一文件夹 #### 使用说明 1.接口地址:http://ip地址:9900/getHotel 2.必要参数:citynane:城市拼音 hotelname:查询的酒店名 startTime:入住时间 格式:2017-5-1 entTime:退房时间 格式:2017-5-2 3.接口实例:http://ip:9900/getHotel?citynane=nanjing&hotelname=朗昇希尔顿酒店&startTime=2019-5-20&endTime=2019-5-21 4.接口返回json的列表格式:[{},{},{}] 5.每个列表是一个字典类型,参数有: 参数 含义 类型 roomname 房间名 str breakfast 是否含早 str Price 价格 int Originalprice 原价 int hasroom 是否有房 str 6.返回类型示例 [{"roomname": "希尔顿双床房(1 双床) 代理", "breakfast": "不含早不可取消", "Price": 737, "Originalprice": 847, "hasroom": "预订"}, {"roomname": "希尔顿客房双床房 代理", "breakfast": "不含早不可取消", "Price": 773, "Originalprice": 883, "hasroom": "预订"}, {"roomname": "希尔顿客房双床房 代理", "breakfast": "不含早不可取消", "Price": 800, "Originalprice": 910, "hasroom": "预订"}] #### 码云特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)