Set up a waiting time before action is to slow down the execution of the current step. Its ultimate purpose is to make sure the steps of the scraper process properly.
Why does it need to "Wait before action"?
In some cases, the previous step may require a certain time to complete, like manual input, or the current page requires a longer time to load. So you would need to set up "Wait before action" for steps like those. Otherwise, it may lead to some errors like missing data.
It is also used to avoid being blocked by the website due to fast scraping. Slowing down the scraping would make the process more human-like.
How to set up "Wait before action"
- You can find "Wait before action" in the "Action Settings" after clicking . on an action in the workflow. All actions created in the workflow are able to set up waiting times.
- Tick "Wait before action" and select a proper time. "Random" means the wait time is random during the scraping process.
- If you want to wait for the page to load the some specific element before scraping, "Wait until a designated element appears" is really useful. You need to enter the XPath of the element and Octoparse will either wait for the setup wait time or wait for the element to appear before going on to the next action.
1. "Wait until a designated element appears" must be set up along with the "Wait before action" to avoid endless waiting.
2. If you are not sure what's the XPath of the element, you can check What is XPath and how to use it in Octoparse. Or use to select an element from the web page and Octoparse would generate an XPath automatically.
If you have questions, you are welcome to submit a request here. Our support team will get back to you later.
Artículo en español: Esperar antes de la acción
También puedes leer artículos de web scraping en sitio web oficial