Why did the "Loop Item" only work for the first item?
FollowQuestion:
I created a "Loop Item" to scrape the list but only the first item was scraped when running local extraction. Why did the "Loop Item" only work for the first item?
Answer:
The reason is that the listing page applies Ajax techniques. There are two methods to solve this kind of problem:
- Add a "Go To Web Page" step as the last step in the "Loop Item" to reopen the listing page.
Here is a sample workflow:
- If there is a button on the detail pages for going back to the listing page, you should click the button, i.e. add a "Click Item" step as the last step in the "Loop Item" to go back to the listing page.
Here is a sample workflow:
- If you are extracting a list of the data in a "Loop Item" and do not check the box for "Use Loop" in Advanced Options, Octoparse will not extract data one by one in the "Loop Item" but instead only extract the first item. Thus, you need to check the box for "Use Loop" to extract all the data.
Tips! |
Artículo en español: ¿Por qué el "Loop Item" solo funcionó para el primer elemento?
También puede leer artículos de web scraping en el sitio web oficial
Author: Yvonne
Editor: Momo