Sessions
Add a session ID to reuse the same proxy (IP Address) for multiple requests.
Sessions are the way websites recognize multiple requests coming from the same address. You can create and use a new session in order to scrape multiple pages of the same website and reuse the same proxy (IP Address) for each request.
The value of the X-WSA-Session-ID header can be any integer and is used to identify the new session created by you.
Web Stealth Proxy Session Examples
curl -k -x "http://stealthproxy.webscrapingapi.com:80" -U "<YOUR-PROXY-USERNAME>:<YOUR-PROXY-PASSWORD>" -X GET "https://httpbin.org/get" --header "X-WSA-Session: 1234"const axios = require('axios');
const https = require('https');
const instance = axios.create({
httpsAgent: new https.Agent({
rejectUnauthorized: false
})
});
instance.get('https://httpbin.org/get', {
proxy: {
host: 'stealthproxy.webscrapingapi.com',
port: 8000,
auth: {
username: '<YOUR-PROXY-USERNAME>',
password: '<YOUR-PROXY-PASSWORD>'
},
headers: {
"X-WSA-Session-ID": "1234"
}
}
}).then(function (response) {
console.log(response.data);
}, (err) => {
console.log(err)
})Last updated