Wait for Element when rendering

If a rendered request is a bit slow and the page stabilises before the request is satisfied, it can fool the API into thinking the page has finished rendering.

To cope with this, you can tell the API to wait for a dom element (selector) to appear on the page when rendering. You just need to send the wait_for_selector= parameter, passing a URL-encoded jquery selector. The API will then wait for this to appear on the page before returning results.

If you are using the Proxy Port Method to send requests to ScraperAPI, you will have to encapsulate the values for "wait_for_selector" in curly brackets if the element you wish to wait for contains a period: "{" and "}"

Example of proxy string: "scraperapi.wait_for_selector={.classname}:password@proxy-server.scraperapi.com:8001".

Last updated