当前位置:   article > 正文

python爬取携程酒店评论_python爬取携程酒店列表

爬取大众点评餐饮数据bs4+request

做个笔记,亲测可用

```python

import requests

import json

from lxml import etree

from bs4 import BeautifulSoup

url = 'https://m.ctrip.com/webapp/hotel/j/hotellistbody?pageid=212093&key=a618c%60iDcf8%C2%A814KGaa035%2FJy2bddcaP%40e65d85d%3Fc61f44d399389006bebbc5cb&huk=S9aJ3pe7Te4PvAnwdYlfYp6E3YLpemkEn4jzaWaYs9jZmw0OJU0jAYoTjH9EbfvgbjMYL6Ia8wl5vAZwHYUcWQ7YTDyUljcSvdFeG1RHfj0leSYkSv0MKgkYGawb9jnke87yhZYtYmYnUvoMem0YHNidqYZYOY1pyDqjanx0PeGPwmMjMfrXgjNlR34iazwo9IU1Y9LjPYmse5LyShi9LiBGjUYoOyBpw8dYhFwFmy7fwakYmDwXY7BRqswTUWMAj9UJcqig6W4HYGdwDaRXUwazjoqRkYGsrQzjhGythw9OjfpjQ8wc8vhzRgOWktRAdyUQYkMiLARdgifYfmRDGw5DWq6JF5yfojHqRdtvFUw8GJ4QJlpYc8RUY6OjmbwApvMqjHYZPROkvzZY3PWaHePnRg8WmZj4AWAYPDRB4vtcY3TWQHeHpRqZWU6Ez6W6YD1RUMw8oW7Tjt0JFciGmW68YZFJt7RhsELSycz'

payloadheader = {

'authority': 'm.ctrip.com',

'method': 'POST',

'path': '/webapp/hotel/j/hotellistbody?pageid=212093&key=a618c%60iDcf8%C2%A814KGaa035%2FJy2bddcaP%40e65d85d%3Fc61f44d399389006bebbc5cb&huk=S9aJ3pe7Te4PvAnwdYlfYp6E3YLpemkEn4jzaWaYs9jZmw0OJU0jAYoTjH9EbfvgbjMYL6Ia8wl5vAZwHYUcWQ7YTDyUljcSvdFeG1RHfj0leSYkSv0MKgkYGawb9jnke87yhZYtYmYnUvoMem0YHNidqYZYOY1pyDqjanx0PeGPwmMjMfrXgjNlR34iazwo9IU1Y9LjPYmse5LyShi9LiBGjUYoOyBpw8dYhFwFmy7fwakYmDwXY7BRqswTUWMAj9UJcqig6W4HYGdwDaRXUwazjoqRkYGsrQzjhGythw9OjfpjQ8wc8vhzRgOWktRAdyUQYkMiLARdgifYfmRDGw5DWq6JF5yfojHqRdtvFUw8GJ4QJlpYc8RUY6OjmbwApvMqjHYZPROkvzZY3PWaHePnRg8WmZj4AWAYPDRB4vtc

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号