Rendering Javascript

If you are crawling a page that requires you to render the Javascript on the page to scrape the data you need, then we can fetch these pages using a headless browser.

To render Javascript, simply set render=true and we will use a headless Google Chrome instance to fetch the page. This feature is available on all plans.

Pass the JavaScript rendering parameter within the URL:

  • API REQUEST

curl "http://api.scraperapi.com/?api_key=APIKEY&url=http://httpbin.org/ip&render=true"
  • PROXY MODE

curl -x "http://scraperapi.render=true:APIKEY@proxy-server.scraperapi.com:8001" -k "http://httpbin.org/ip"

Pass the parameter in the headers:

  • API REQUEST

curl "https://api.scraperapi.com/?api_key=<API_KEY>&url=https://www.example.com" -H "x-sapi-render: true"
  • PROXY MODE

curl -k --proxy “http://scraperapi:<API_KEY>@proxy-server.scraperapi.com:8001” https://www.example.com -H “x-sapi-render: true

Last updated