exiang
(Yixiang)
January 7, 2020, 7:12am
1
Hi All
I am trying to extract data on a webpage to fill up my database. I need UIpath to select the correct name and click it. The correct name is either “bulk carrier” “or ex vessel”. May i know what is wrong with my selector using regex?
[selector editor]
AshwinS2
(Ashwin S)
January 7, 2020, 7:37am
2
Hi @exiang
Instead of regex you can do it based on array
StrText=Split(“”.ToCharArray)
and print the values within for each item
Thanks
Ashwin S
Yoichi
(Yoichi)
January 7, 2020, 7:42am
3
Hi,
Can you try the following?
<webctl matching:aaname='regex' aaname='^bulk.*|.*ex.*' parentid='app' tag='SPAN' />
Please note regex in selector is Case Sensitive.
Regards,
exiang
(Yixiang)
January 7, 2020, 7:50am
4
Hi Yoichi
Nope. the error msg is syntax error in the selector. I changed the first font to capital letter.
How do i write “Bulk Carrier” or “Ex Vessel” on the selector?
Yoichi
(Yoichi)
January 7, 2020, 8:07am
5
Hi,
How about the following?
<webctl matching:aaname='regex' aaname='(Bulk Carrier)|(Ex Vessel)' parentid='app' tag='SPAN' />
In my environment, there is no syntax error.
It might depend on UiAutomation.Activity Package. Which version do you use?
Regards,
exiang
(Yixiang)
January 7, 2020, 8:35am
6
Hi Yoichi
I upgraded to 19.12.0-preview. However, it is still showing syntax error. I attached my file for your check. Many thanks for your help.
extractvesselname.xaml (10.0 KB)
Yoichi
(Yoichi)
January 7, 2020, 8:56am
7
Hi,
Thank you for sharing your workflow.
I just reproduced your problem and I found it causeed my typo for webctrl. (Sorry)
Can you try the following?
<webctrl matching:aaname='regex' aaname='(Bulk Carrier)|(Ex Vessel)' parentid='app' tag='SPAN' />
Regards,
exiang
(Yixiang)
January 7, 2020, 2:11pm
8
thank you v much. It works! I managed to used
Just for my knowledge in regex:
.* means “zero or more of any character"?
1 Like
Yoichi
(Yoichi)
January 7, 2020, 2:43pm
9
Hi,
That’s good to hear.
.
means any character except line break.
*
means 0 or more.
So, .*
means zero or more of any character except line break.
Regards,
Hi,
I am trying to use regex for my selector. but it is not working. could you please help me with the below regex for selector.
I tired the above regex but both are not validating.
Please find the attached images for reference.
Both will work if I click on the object in different navigation method.