Unable to capture the client ID, Client Name, Client country

Hi I am not able to capture separate client id, name and country from the customer fetching details. below attached the screenshot. when I try to bring the cursor on id, name and country so it’s capturing left side Client ID:, Client Name: and Client Country not RN58561, Alvaro Dash and France.
image

@balkishan You won’t get the individual selectors for that,so you need spy entire div then need to split it by using string operations.

How can we use string split method here, could you plz tell me

@balkishan,

Use GetText activity to capture that string and then use string manipulation operators to divide it individual.

Regards,
Lakshman Ganta.

image

Once I captured this what should I do next?

Can you tell me how to use string manipulation in this

Use Split String. GIive Input as Get Text Output
Use “:” as the Separator.
Output would be array of string.

Hi @balkishan

Checkout the attached workflow… This might help you to get it sorted…

System1_ExtractClientInformation.xaml (16.0 KB)

1 Like

@balkishan,
Use below one:

Client ID: Client.Substring(Client.IndexOf("Client ID: ")+"Client
ID: ".Length).Split(Environment.NewLine.ToCharArray)(0)

And same way try for other Two also.

2 Likes

@balkishan I have attached a work flow please go through it and let me know Main.xaml (8.1 KB)

Regards,
Mahaling Patil

@MahalingPatil : As I went through your workflow here you didn’t declare any out parameter bro

I have created variables,you could have create arguments and assign values to arguments.

Regards,
Mahaling Patil

You must have variables, Clientinfo which type is a GenericValue and idtoremainstr which type is a string array, three arguments out_ClientID, out_ClientName and out_ClientCountry then Use an Assign Activity

assign idtoremainstr = clientinfo.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)

Assign
out_ClientID = idtoremainingstr(0).Split(":“c)(1).Substring(1)
out_ClientName = idtoremainingstr(1).Split(”:“c)(1).Substring(1)
out_ClientCourtry = idtoremainingstr(2).Split(”:"c)(1).Substring(1)
To see if it’s doing what you expect it to do you can print it using Write Line activity and put the below on Text

out_ClientID+“-”+out_ClientName+“-”+out_ClientCountry

Thanks for your efforts bro.
BTW you already declared a clientdetails var type generic in the workflow. Can you tell me why do we need to declare idtoremainstr ?

If you look we are using idtoremainstr variable which is an array to split the values in the Get text.

Clientinfo is the Value in the Get Text property
image

2 Likes

Simple words the idtoremainstr stores the value from our Get Text activity them split them using the New Line

Hope this will be helpful

1 Like

Yes, It helps a lot bro :slight_smile:

1 Like

You are welcome

1 Like

Hey thanks for this @lakshman . It was very useful. Do you think you could take me through the lines and explain what is going on? I get that its finding client ID and the length of the word and grabbing that. But that is all I understand. Is the client ID portion a selectors thing? Or would it work on any website with that kind of data? → IE if it said “customer ID” would it still work?

1 Like

No.

Yes it will work. In this case, you have to replace Client ID with customer ID