Python crawler-a certain website hotel data

Preface

This article is the fifth article of this column. I will continue to share useful information on python crawler cases in the future, so remember to pay attention.

This article takes the hotel data of a certain website as an example to obtain hotel data based on the target city. For specific ideas and methods, follow the author directly to the text for details. (complete code attached)

text

Address : aHR0cHM6Ly93d3cuYnRoaG90ZWxzLmNvbS9saXN0L3NoYW5naGFp

Goal : Obtain hotel data based on the target city


1. Request method and parameters

Before you begin, it should be noted that the author's explanation in this article only uses a certain city as an example. If you want to obtain hotel data in the target city, you only need to change the parameters of the target city and the corresponding number of the target city.

After opening the url with a browser, directly launch the developer tools with the F12 key. Randomly click the page turn button and observe the changes in the console area on the right, as shown below. The page request method and parameters will not be described in too much detail here. The previous article in this column has a detailed introduction. Interested students can read forward and then go directly to the topic of this article.

Guess you like

Origin blog.csdn.net/Leexin_love_Ling/article/details/132592568
Recommended