Oxylabs’ Trip Scraper is a data gathering solution allowing you to extract real-time information from a Trip.com website effortlessly. This brief guide explains how a Trip Scraper works and provides code examples to understand better how you can use it hassle-free.
You can get Trip results by providing your own URLs to our service. We can return the HTML for any Trip page you like.
The example below illustrates how you can get HTML of Trip page.
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'universal',
'url': 'https://www.trip.com/flights?locale=en-xx&allianceid=742331&sid=2506234&ppcid=adid-660427218467_akid-kwd-11635721_adgid-144762786930&utm_source=google&utm_medium=cpc&utm_campaign=sitelink&utm_extensiontype=sitelink&utm_extension=flight&gad_source=1&gclid=cj0kcqia7oqrbhd9arisak3uxh0t8thl3l86ic0h1fo1wind3utjhjhrafxiu3yeyfc3trwbfv4pz0kaahvlealw_wcb'
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('user', 'pass1'),
json=payload,
)
# Instead of response with job status and results url, this will return the
# JSON response with the result.
pprint(response.json())Find code examples for other programming languages here
{
"results": [
{
"content": "<!DOCTYPE html><html lang=\"en-XX\" data-idc=\"SHARB\" style=\"font-size:57.5px\" data-cargo=\"locale:en-XX ... </html>",
"created_at": "2023-12-18 11:21:22",
"updated_at": "2023-12-18 11:21:24",
"page": 1,
"url": "https://www.trip.com/flights?locale=en-xx&allianceid=742331&sid=2506234&ppcid=adid-660427218467_akid-kwd-11635721_adgid-144762786930&utm_source=google&utm_medium=cpc&utm_campaign=sitelink&utm_extensiontype=sitelink&utm_extension=flight&gad_source=1&gclid=cj0kcqia7oqrbhd9arisak3uxh0t8thl3l86ic0h1fo1wind3utjhjhrafxiu3yeyfc3trwbfv4pz0kaahvlealw_wcb",
"job_id": "7142473917087645697",
"status_code": 200
}
]
}With our Trip Scraper, you can smoothly glean public information from any Trip.com web page. Draw out crucial travel specifics such as flight details, hotel bookings, eateries, or locations, to plan your journey seamlessly and stay updated on your travel plan. If you encounter any hiccups, get in touch with our support team via live chat or email us at hello@oxylabs.io.
