JavaScript Rendering

If the page you intend to scrape necessitates the execution of JavaScript in order to dynamically load all the necessary data you may enable JavaScript rendering without the need of using a headless browser.

Receive rendered page content in HTML

curl -k -v -x unblock.decodo.com:60000 \ -U "USERNAME:PASSWORD" "https://ip.decodo.com/" \ -H "X-SU-Headless: html"
import requests proxies = { 'http': 'http://USERNAME:[email protected]:60000', 'https': 'http://USERNAME:[email protected]:60000' } headers= { "X-SU-Headless": "html" } response = requests.request( 'GET', 'https://ip.decodo.com/', verify=False, proxies=proxies, headers=headers ) print(response.text) 
import fetch from 'node-fetch'; import createHttpsProxyAgent from 'https-proxy-agent' const username = 'YOUR_USERNAME'; const password = 'YOUR_PASSWORD'; const agent = createHttpsProxyAgent( `http://${username}:${password}@unblock.decodo.com:60000` ); process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0; const headers = { 'X-SU-Headless': 'html' } const response = await fetch('https://ip.decodo.com/', { method: 'get', headers: headers, agent: agent }); console.log(await response.text());

Receive rendered page content as PNG

The response will contain raw bytes of an image that can be saved in PNG format

curl -k -v -x unblock.decodo.com:60000 \ -U "USERNAME:PASSWORD" "https://ip.decodo.com/" \ -H "X-SU-Headless: png"
import requests proxies = { 'http': 'http://USERNAME:[email protected]:60000', 'https': 'http://USERNAME:[email protected]:60000' } headers= { "X-SU-Headless": "png" } response = requests.request( 'GET', 'https://ip.decodo.com/', verify=False, proxies=proxies, headers=headers ) print(response.text) 
import fetch from 'node-fetch'; import createHttpsProxyAgent from 'https-proxy-agent' const username = 'YOUR_USERNAME'; const password = 'YOUR_PASSWORD'; const agent = createHttpsProxyAgent( `http://${username}:${password}@unblock.decodo.com:60000` ); process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0; const headers = { 'X-SU-Headless': 'png' } const response = await fetch('https://ip.decodo.com/', { method: 'get', headers: headers, agent: agent }); console.log(await response.text());

Support

Still can't find an answer? Want to say hi? We take pride in our 24/7 customer support. Alternatively, you can reach us via our support email at [email protected].

Feedback

Something's missing? Request an article!
Got feedback? Let us know how we're doing and what can be improved.


close