Repeat-Tutorial

Repeat
🔁

Repeat

Property
Status

💡
How to loop over items on website using DataKund?

📌 TRAINING


Static

  • Create a New Bot and Click on the Train button.
  • Open url ‘https://pypi.org/search/?q=datakund’ and then we can see the charts by clicking on extension icon as shown below. As we opened a url so “open link” event is shown in charts.

  • Add repeat begin event by selecting the area upon which we want to apply loop by Right Click>DataKund>Repeat>Element Repeat>Begin Repeat.

  • Repeat event is added in chart.

Element repeat is for the items shown on webpage, and text repeat is for the text separated by “\n”.For example “Shoes \n books \n clothes” can be used for text repeat which will loop on three items separated by “\n”.

Dynamic

You can repeat dynamically e.g you want to search a list of keywords coming in input variable ‘keywords ’.

  • Then first you need to add ‘keywords’ variables.

  • Then in training RIGHT CLICK>DataKund>Inputs>Variables>keywords>repeat. Then you can use the repeat item anywhere in keypress, openlink, paste etc.

The event next to "repeat" decides what to repeat and how many times to repeat, e.g if clicked after repeat bot will click on all items. The events after "repeat" will be repeated as well. We want to click on each item and scrap data and then close the tab. So we will now click on the first item, and as result, it will open that item in a new tab. After a click, two events will be added one is clicked and the other is switched because we switched automatically to the item tab.

  • Now save the title of an item in excel by performing a save event.
  • Select the title and Right click>Datakund>Scrape >Text >Column A. It will save the title in column A. The Excel file can be located at Downloads>DataKund folder.

  • Close the tab now and switch back to the main page. New events will be added close tab and switch.
  • Now can stop training by clicking on the stop button. Wait till the loading gets finished. Here the Training part ends.

  • Now you can scrape data by putting any keyword dynamically

📝 Know More:

👆Click

🔗Url

🖥️Open Link in New Tab