Search code examples
uipathuipath-studio

Uipath Studio - Data scrape a list of different products and write into csv, but all .csv file have exactly same data


I have a csv file with a list of products and I want to scrape data from them automatically.

The rpa bot I created is able to repeat the search of the product using my list on an e-commerce website. It will search until every product name from the list was used. However, the bot will only scrape data from the first product of my csv list and write a new csv file to store the scraped data. After scraping the first product, the bot will then continue search the second product, as well as the third and fourth product and write a new csv file. However, when I open the csv file of second product, the data is exactly same as the first product's data scrape. This shows that the rpa bot did not conduct the data scrape when it searched the second product onward. Why does that happen?

.CSV Product List Process's Image Write CSV Properties Extract Structured Data 'DIV' Properties

XML Code of Extract Metadata, from Extract Structured Data DIV

    <row exact='1'>
        <webctrl tag='div' class='ant-col-20 ant-col-push-4 c1z9Ut' idx='1'/>
        <webctrl tag='div' idx='2'/>
        <webctrl tag='div' class='ProductGrid-container' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-container'/>
        <webctrl tag='a' class='RedmartProductCard-link' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-content' idx='1'/>
    </row>
    <column exact='1' name='item' attr='text' name2='item&apos;s url' attr2='href'>
        <webctrl tag='div' class='ant-col-20 ant-col-push-4 c1z9Ut' idx='1'/>
        <webctrl tag='div' idx='2'/>
        <webctrl tag='div' class='ProductGrid-container' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-container'/>
        <webctrl tag='a' class='RedmartProductCard-link' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-content' idx='1'/>
        <webctrl tag='h4' class='RedmartProductCard-title' idx='1'/>
    </column>
    <column exact='1' name='current price' attr='text'>
        <webctrl tag='div' class='ant-col-20 ant-col-push-4 c1z9Ut' idx='1'/>
        <webctrl tag='div' idx='2'/>
        <webctrl tag='div' class='ProductGrid-container' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-container'/>
        <webctrl tag='a' class='RedmartProductCard-link' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-content' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-priceContainer' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-price sg' idx='1'/>
    </column>
    <column exact='1' name='quantity' attr='text'>
        <webctrl tag='div' class='ant-col-20 ant-col-push-4 c1z9Ut' idx='1'/>
        <webctrl tag='div' idx='2'/>
        <webctrl tag='div' class='ProductGrid-container' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-container'/>
        <webctrl tag='a' class='RedmartProductCard-link' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-content' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-weight' idx='1'/>
    </column>
    <column exact='1' name='amount of rating' attr='text'>
        <webctrl tag='div' class='ant-col-20 ant-col-push-4 c1z9Ut' idx='1'/>
        <webctrl tag='div' idx='2'/>
        <webctrl tag='div' class='ProductGrid-container' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-container'/>
        <webctrl tag='a' class='RedmartProductCard-link' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-content' idx='1'/>
        <webctrl tag='div' class='RedmartProductCard-footerContainer' idx='1'/>
        <webctrl tag='div' class='Rating-container' idx='1'/>
        <webctrl tag='div' class='Rating-review' idx='1'/>
    </column>
</extract>

Solution

  • Use the activity clear data table after writing it to the .csv file. It might work for you.

    As you are using a loop it might not overwrite some times.