My Robot Does Not Work

Sorry guys. I just started my learning in RPA and I tried to extract data from the website for three minutes and then displayed the highest and lowest stock prices in Excel, but it did not work. It can just display the initial stock price in cell A2, and then the program ends immediately. Please give some help to me. Thank you.
image


image
image
image

image

1 Like

I think it’s because of the condition
Because for Do while only if the condition matches it will continue the loop
If not gets out of loop

As starttime = starttime.AddMinutes(3)

Is obvious not going to be equal so the loop stops there and thus enter in only for A2 cell

Keep it like this

Use a assign activity first

Starttime = Datetime.Now

Now in the loop mention condition as
(Datetime.Now - StartTime) < TimeSpan.FromMinutes(3)

Hope this helps

Cheers @CHAN_Hiu_Fung_Victor_Stud

While” loop, “Get Text” activity, and variables to track the highest value. Here’s the steps.

1.Initialize Variables

  • highestValue = 0
  • startTime = Current Time

2.Take While loop (Condition: Check if the time elapsed is less than three minutes)
inside the loop take Get Text activtiy (to extract the current value from the website)
Assign ( value to currentValue)

*If
Then
(currentValue > highestValue)
LHS RHS

  • Assign (highestValue = currentValue)-Assign (startTime = Current Time)

End Do While’

it will check the until three mints and you will get the highest value for three mints

@CHAN_Hiu_Fung_Victor_Stud

You can Initialize the StartTime variable like this

@CHAN_Hiu_Fung_Victor_Stud