Trip Scraper avatar
Trip Scraper

7 days trial then $30.00/month - No credit card required now

View all Actors
This Actor is under maintenance.

This actor is under maintenance and it may unreliable.

Trip Scraper

Trip Scraper

lhotanok/trip-scraper

7 days trial then $30.00/month - No credit card required now

This Trip Scraper will extract data for different types of accommodation from Trip.com website.

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn mode

Node.js

Python

curl

1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with API token
4const client = new ApifyClient({
5    token: '<YOUR_API_TOKEN>',
6});
7
8// Prepare Actor input
9const input = {
10    "startUrls": [
11        "https://www.trip.com/hotels/list?city=633&cityName=New%20York&provinceId=0&countryId=66&districtId=0&checkin=2023%2F10%2F19&checkout=2023%2F10%2F21&barCurr=USD&searchType=CT&searchWord=New%20York&crn=1&adult=2&children=0&searchBoxArg=t&travelPurpose=0&ctm_ref=ix_sb_dl&domestic=true&listFilters=17%7C1*17*1*2%2C80%7C0%7C1*80*0*2%2C29%7C1*29*1%7C2*2"
12    ],
13    "maxHotels": 5,
14    "proxyConfiguration": {
15        "useApifyProxy": true
16    }
17};
18
19(async () => {
20    // Run the Actor and wait for it to finish
21    const run = await client.actor("lhotanok/trip-scraper").call(input);
22
23    // Fetch and print Actor results from the run's dataset (if any)
24    console.log('Results from dataset');
25    const { items } = await client.dataset(run.defaultDatasetId).listItems();
26    items.forEach((item) => {
27        console.dir(item);
28    });
29})();
Developer
Community logoMaintained by Community
Actor metrics
  • 4 monthly users
  • 0.0% runs succeeded
  • Modified 4 months ago
Categories

You might also like these Actors