Wait when rendering Javascript
Let's say you want to scrape a website that renders its data slowly then in that case, you can use our wait parameter along with the dynamic parameter. wait parameter is actually a time for which you want to wait for a headless browser to keep loading the website. It is in milliseconds and its minimum value is 0 and the maximum value is 35000.
API Example
curl "https://api.scrapingdog.com/scrape?api_key=5e5a97e5b1ca5b194f42da86&url=http://httpbin.org/ip&wait=5000"import requests
url = "https://api.scrapingdog.com/scrape"
params = {
"api_key": "5e5a97e5b1ca5b194f42da86",
"url": "http://httpbin.org/ip",
"wait": "5000"
}
response = requests.get(url, params=params)
print(response.text)const axios = require('axios');
const apiUrl = 'https://api.scrapingdog.com/scrape';
const apiKey = '5e5a97e5b1ca5b194f42da86';
const targetUrl = 'http://httpbin.org/ip';
const params = {
api_key: apiKey,
url: targetUrl,
wait: "5000"
dynamic: dynamic.toString(),
};
axios
.get(apiUrl, { params })
.then((response) => {
if (response.status === 200) {
console.log(response.data);
} else {
console.error(`Failed to retrieve data. Status code: ${response.status}`);
}
})
.catch((error) => {
console.error('An error occurred:', error.message);
});
Last updated