While Scraping when it dosent find the number it repeats the previouse scraped number

So I my scraping robot works but I purposly put a wrong link to see what happens in case of error and when it dosent find the object to be scraped its repeating the previous number.

Where did I give that order and how can I change it so it can leave that cell in blank or for example put a not found text.
(The most importan thing for me is to understand why te robot decided to repeat a previous number)



Hi @Favarelaa

In the write cell activity give the cell value as Excel.Sheet(“Sheet2”).ByField(“Column name”).

In for each row activity check the save after each row option

Hope it helps!!

thank you, but it still happens.

Okay @Favarelaa

Then take an If condition activity after the assign activity then check PRRR variable contains any value.
In If condition give like this

PRRR.Any

In then block give the write cell activity and give the PRRR variable in what to write field.
In else block give the one more write cell activity just give “” double quotes in the what to write field. If there is no value in the variable it writes blank.
After every write cell activity place the assign activity and give PRRR = Nothing

Check the below workflow for your better understanding
Email Process.zip (231.6 KB)

Hope you understand!!

Show us your selector for the Get Text activity.

Also, you should use Strict Selector, not Fuzzy Selector, so that it’s exact and won’t use a similar element if the exact element isn’t found.

@Favarelaa

Is it working for you. If you have any queries let me know.

1 Like

Thank you!!
Well your form didnt work for me yet but im still working on it because it makes sence, so I still want to be able to apply it.

What I did learn from your formula is that the reason it repeated the previouse number is because I saved the previosue number to the variable PR.

So when it runs again and dosent find anything, PR still has the previouse number saved in.

I was abble to fix it by putting an assign activity that made PR = “” (I believe “Nothing” dosent work with excel.

Ill keep working on your formula, thank you for all the help!!

So here I applied part of your formula but im not getting results. Can you take a look?

I was told Pr.Any is for arrays that it was more pricise to use
Not String.IsNullOrEmpty(PR) And PR <> “Error”.

I tried with both but it keeps repeating the previous number.


image

So I found the problem.
The problem is that in my flow chart when I Scrape the Price I Save it in to the variable “PR”. And for an example lets say the number is 5,5.

After that I use an Assign activity to adapt the number with no comas, and save that result in to “PRRR”. In this example PRRR is 55.

At this point “PR” keeps beeing 5,5.

Then I write in cell PRRR (55).

When we go to next row and the link is broken it has nothing to scrape, but the get text activity is configured to keep going on error. Since it scraped nothing, “PR” keeps beeing 5,5.

Then it goes to the Assign activity end transforms PR to PRRR.

Finally in write cell it repeats the number 55.

SOLUTION: After the Write Cell Activity, I use an Assign Activity that saves PR to the following value: “Could not Scrape”, so if next row it cant scrape the PR variable will be “Could not Scrape” and will write to cell “Could not Scrape” insted of previouse scraped number.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.