The basics of forming an input code for scraping travel industry pages with Tripadvisor Scraper API + an example of results.
Project description
Tripadvisor Scraper
Tripadvisor Scraper API is an advanced web data extraction solution with an emphasis on scale, saved time, and instant results. The following introduces the basics of getting started with Tripadvisor Scraper API.
How it works
You can provide us with any Tripadvisor URL, and we will return the results right away.
Python input code example
The code example below shows an input code to be provided to the API.
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'universal',
'url': 'https://www.tripadvisor.com/Restaurants-g60763-New_York_City_New_York.html',
'user_agent_type': 'desktop',
'geo_location': 'United States'
}
# Get a response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload
)
# Instead of response with job status and results url, this will return the
# JSON response with results.
pprint(response.json())
Output example
{
"results": [
{
"content": "<!doctype html>
<html lang="en">
<head>...</script></body>
</html>
",
"created_at": "2023-07-26 12:07:08",
"job_id": "7089939195182992385",
"page": 1,
"status_code": 200,
"updated_at": "2023-07-26 12:07:41",
"url": "https://www.tripadvisor.com/Restaurants-g60763-New_York_City_New_York.html"
}
]
}
Tripadvisor Scraper API automates the bulk of the underlying processes and ensures a block-free experience.
If you have any questions, please email us or drop a message via the live chat on our homepage.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Tripadvisor-scraper-0.1.0.tar.gz
.
File metadata
- Download URL: Tripadvisor-scraper-0.1.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2cfcab381c464543ef15599a7b4a88d7200424745f79b614574ffa2585b9a0b |
|
MD5 | 56c8ab3f933cbe7f1148367240e88581 |
|
BLAKE2b-256 | f4c5814148bb2c03fdb337fa8833855a4dcc23bf4091fcb5bb123d62044a608f |
File details
Details for the file Tripadvisor_scraper-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: Tripadvisor_scraper-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 471171586fbfb1f4b3b7f3f37b41b1d49a6d7f481814354531aba8d37f997c0d |
|
MD5 | 8865ceb6f600000b9ebe37fee6d9787d |
|
BLAKE2b-256 | 8c8c27405d446e51341f99d1450d17ac9d2a983cedc26798aef0f35086312089 |