Open URL from Excel column (A1) and mark the next column (A2) if there is error 404

Hi, I am new to the UiPath. I want to open up the URLs from excel columns (A1, A2, A3…). The pages will either have the JPG image or the error 404. I want to mark the next columns (B1, B2, B3…) with “Error” or “No Error”. Could someone please help?

1 Like

Hi @Tapan

Kindly follow the below steps to get the issue resolved

  1. Excel application scope activity to open the excel. And pass the excel path as input
  2. Use read range activity to get the output with variable of type datatable named out_dt
  3. Use a for each row to iterate through each row in the table…by passing the input as out_dt
  4. Now use a open browser activity and us click and type into activity to pass the value of url like this in type into
    Row(urlcolname). ToString
  5. Then use a element exists or image exists activity to check whether the element you want exist or not
  6. Then use a write cell activity to update the column u want with input of sheetname and range be like this
    “A” + counter.ToString
    Where counter is a incrementing counter of type integer with default value as 1
  7. Thats all you are all done

Tty this and let know whether this works or not
Cheers buddy @Tapan

1 Like

Hi Palaniyappan, I appreciate your help on this.

Looks like i am doing it wrong. I am not able to define variables correctly. Would you be able to look at the file with teamviewer by any chance?

1 Like

Kindly send the xaml @Tapan

yah sure @Tapan

Building on this, instead of using element exists you could use screen scraping on the websites, and see if they contain 404 text. only if the two scenarios are image or 404 though.

2 Likes

I am unable to attach xaml. Tried that yesterday as i am a new user.

try this…

1 Like

Hi @Tapan

Here is your xaml its resolved
Main.zip (2.9 KB)

Kindly try this and let know whether this works or not
Cheers

Hi Palaniyappan, Please see the error below-

18.3.1+Branch.master.Sha.4c05f670b311e90ee097c589605b399e9bee4874

The workflow has validation errors. Review and resolve them first.

Compiler error(s) encountered processing expression “row(“urlcolname”).ToStringRow(urlcolname). ToString”.
Option Strict On disallows late binding.
‘urlcolname’ is not declared. It may be inaccessible due to its protection level.

Hi @Tapan as i don’t what is your column name in your excel, i mentioned to tell you indicate the colunnname in your excel here
row(“columnname”).ToString, mention the column name in your excel
image

Did that work @Tapan

Nope, Unable to change that. :frowning:

Unzip and try it must be in read only mode

Compiler error encountered processing expression “row(“urlcolname”).ToStringRow(urlcolname). ToString”.

Option Strict on disallows late binding.
urlcolname is not declared. It may be inaccessible…

no don’t mention any argument in tostring like this ToStringRow(urlcolname).
this alone row(urlcolname).ToString

And mention the columnname inside the double quotes

Cheers @Tapan

could you pls check it once via teamviewer?
ID- 1 173 796 068
pwd- pfd379

1 Like

i m not able to access the url
can you send the xaml or by personal message here in forum @Tapan

i tried from scratch, updated dependencies. Changed indicative screenshot and now error-

18.3.1+Branch.master.Sha.4c05f670b311e90ee097c589605b399e9bee4874

Source: Open Browser

Message: Column ‘urlcolname’ does not belong to table .

Exception Type: System.ArgumentException

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.ArgumentException: Column ‘urlcolname’ does not belong to table .
at System.Data.DataRow.GetDataColumn(String columnName)
at System.Data.DataRow.get_Item(String columnName)
at lambda_method(Closure , ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity) at System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor)
at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityExecutor executor, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath)
at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

FYI- I am not able to edit anything under -Open Browser - Input- Url- row(“urlcolname”).ToString

when i run it, the excel opens up and disappears and error comes up.

Thanks for your efforts…

1 Like