AryanSingh
(Aryan Singh)
September 19, 2019, 12:05pm
1
Hello
Can we directly pass the variable in the selector?
Like we are saving the selector in the variable below. But what if i want pass the variable in the selector directly.
Example:: Var1 ="<html app='chrome.exe' title='Smart Search | LinkedIn Recruiter' /><webctrl tag='A' css-selector='body>div>div>section>div>section>footer>nav>div>ul>li>a' idx='"+initPCount.ToString+"' />"
Anyone help me?
3 Likes
vishal.kp
(vishal)
September 19, 2019, 12:06pm
2
In which selector are you trying you use the variable. Can you show the selector?
indra
(Indra)
September 19, 2019, 12:07pm
4
@AryanSingh Yes you can pass variables in the selectors.
vishal.kp
(vishal)
September 19, 2019, 12:08pm
5
yes definitely you can pass that variable inside the selector. The condition is always the variable type should be in string or generic type.
1 Like
vishal.kp
(vishal)
September 19, 2019, 12:10pm
6
Try as much as possible to avoid the css in the selectors. They are unstable.
1 Like
Palaniyappan
(Palaniyappan P )
September 19, 2019, 12:11pm
7
AryanSingh:
Can we directly pass the variable in the selector?
Like we are saving the selector in the variable below. But what if i want pass the variable in the selector directly.
Example:: Var1 ="<html app='chrome.exe' title='Smart Search | LinkedIn Recruiter' /><webctrl tag='A' css-selector='body>div>div>section>div>section>footer>nav>div>ul>li>a' idx='"+initPCount.ToString+"' />"
yah of course we can pass the variable in the selector
but we need to keep these things in ming
–whenever a variable is passed to a selector it should be like this
attributename like
aaname = ’ " + variablename.ToString + " ’
–and if we are passing variable to a selector that change should not be made inside the SELECTOR EDITOR
–instead we need to pass the variable to the selector attribute and copy that whole selector and pass that as a STRING value between double quotes to the SELECTOR property in the property panel of any activity we use
–the reason is sometimes the variable passed with selector inside the SELECTOR EDITOR wont work or it wont take either the variable been passed
–so if we pass that whole selector as a string value to the selector property it would work for sure
hope this would help you
Cheers @AryanSingh
1 Like
AryanSingh
(Aryan Singh)
September 19, 2019, 12:17pm
8
@Palaniyappan
@vishal.kp
@indra
So, we need to use the variable in the double quotes in the selector right?
2 Likes
Palaniyappan
(Palaniyappan P )
September 19, 2019, 12:18pm
9
yes exactly
like this
attributename = ’ " + variablename.ToString + " ’
Cheers @AryanSingh
1 Like
vishal.kp
(vishal)
September 19, 2019, 12:18pm
10
Not in double quotes . just pass the variable. Its simple as that. when you pass it inside double quotes the variable is converted to string.
1 Like
AryanSingh
(Aryan Singh)
September 19, 2019, 12:19pm
11
@Palaniyappan
Ok thanx. Let me try.
Please check your inbox i have one query!
1 Like
Palaniyappan
(Palaniyappan P )
September 19, 2019, 12:20pm
12
oh
i didnt get any buddy
Cheers @AryanSingh
Palaniyappan
(Palaniyappan P )
September 19, 2019, 12:26pm
14
yah sure
did this get resolved
Cheers @AryanSingh
1 Like
AryanSingh
(Aryan Singh)
September 19, 2019, 12:28pm
15
@Palaniyappan
Will check and tell if resolved.
AryanSingh
(Aryan Singh)
September 19, 2019, 1:20pm
17
@Palaniyappan
Can we use while activity to iterate through all pages and extract the data individually for the page?
Palaniyappan
(Palaniyappan P )
September 19, 2019, 1:22pm
18
hmm yah of course
but we need to mention the page number in selector by passing a variable and make sure that a counter is used and incremented as well
Cheers @AryanSingh
AryanSingh
(Aryan Singh)
September 19, 2019, 1:24pm
19
@Palaniyappan
Yeah i am trying to do that but it is not able to do it properly. Repeating same values.
AryanSingh
(Aryan Singh)
September 19, 2019, 1:25pm
20
@Palaniyappan
How can i use the data scraping activity to iterate through all the pages?
Can you guide me regarding that?