AIRBNB SCRAPING DATA EXTRACTION METHOD

Asked 1 years ago, Updated 1 years ago, 87 views

Rather than programming, this is a question about the structure of airbnb's site.

I'm scraping airbnb on Python, and I'd like to extract listing IDs by prefecture.In what way can I scrap all the listing IDs in the prefecture?

web-scraping

2022-09-29 21:50

1 Answers

Rather than collecting information for scraping and taking time through trial and error, I think it would be faster and more reliable to sign up for official Airbnb API materials.You don't have to worry about changing specifications or blocking them.

API Partner

Connect to your API.
Connect to millions of travelers on Airbnb.

Summary Information Page Collected and Listed by Third Parties
Airbnb API|ProgrammableWeb

Airbnb Officially Launches an API
The long awaited Airbnb API is officially here. While Airbnb has publicly announced its official API, the API is not completely open to the public. That interested must apply from access.Public documentation is not current available. The focus of the public API.

Airbnb officially announces API
The long-awaited Airbnb API is officially here. Airbnb has publicly announced its official API, but it is not fully open to the public. If you are interested, please apply by accessing. Public documents are not currently available. The focus of the first API launch is on the supply side.

Apart from that, it seems that this request will be made if a visitor who has not registered a user searches the Airebnb site.

https://www.airbnb.jp/s/ Okinawa -- Japan/homes?guests=1&refinment_paths%5B%5D=%2Fomes&allow_override%5B%5D=&s_tag=IQcJExOH
https://www.airbnb.jp/s/ Tottori Prefecture -- Japan/homes?guests=1&refinment_paths%5B%5D=%2Fomes&allow_override%5B%5D=&s_tag=o65CaWlw
https://www.airbnb.jp/s/ Miyagi Prefecture -- Japan/homes?guests=1&refinment_paths%5B%5D=%2Fomes&allow_override%5B%5D=&s_tag=tfElWPeh

"Search ""Okinawa Prefecture, Japan, Accommodation"", ""Tottori Prefecture, Japan, Accommodation"", and ""Miyagi Prefecture, Japan, Accommodation"" respectively."
The s_tag=XXXX part at the end is just different, so that part (IQcJExOH, o65CaWlw, tfElWPeh) may represent the prefecture.

"However, when I searched for ""Okinawa prefecture, Japan, and accommodation"" using a different procedure than above, another request came out."

https://www.airbnb.jp/s/ Okinawa Prefecture -- Japan/homes?refinment_paths%5B%5D=%2Fomes&guests=1&query=Okinawa Prefecture %2C%20 Japan&allow_override%5B%5D=&s_tag=OWuXfaCk

guests=1 is misaligned, &query=Okinawa %2C%20 Japan is in the middle, and s_tag=OWuXfaCk is different from the beginning, so some other information or rule may have been applied.

If you have a lot of experience/knowledge in scraping, you may find this mechanism short.

add
When I thought of it and searched only the head part, it was okay.
Below is the same as searching for Okinawa prefecture, Japan, and accommodation.

https://www.airbnb.jp/s/ Okinawa Prefecture -- Japan/homes

It's the same in Okinawa prefecture alone, but the number of cases is not enough for one display, so if you scroll down, you'll see a continuation.
Well, it's become simple, but you still need a lot of ingenuity to use it.


2022-09-29 21:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.