Ation designer, reg ex problem

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
so im having a issue in the reg ex it seems to work perfectly
Код:
(?<=Contacts.*?)<div class="[\w\W]{5}"><!-- react-text: [\d]{1,7} -->name<!-- /react-text --><!-- react-empty: [\d]{1,7} --></div>(?=.*?Businesses)
Код:
<div class="_11_d _4p-s"><div class="_29hk"><ul class="_29hl" role="listbox" id=""><li role="option" class="_3h3c _5l37"><a href="#" tabindex="0" class="_5f0v"><div direction="left" class="clearfix"><div class="_ohe lfloat"><div class="_5l39 _5rmm"><div style="width: 32px; height: 32px;" class="_4ldz"><div style="width: 32px; height: 32px;" class="_4ld-"><i width="32" height="32" alt="" class="img sp_PmxzVEQLNDC sx_80f878"></i></div></div></div></div><div class=""><div class="_5l38 _42ef"><div class="_364g"><!-- react-text: 4964 -->Search Messages for "name"<!-- /react-text --><!-- react-empty: 4965 --></div></div></div></div></a></li></ul></div><div class="_29hk"><div class="_225b"><em data-intl-trid="" data-intl-translation="Contacts" class="_4qba"><!-- react-text: 4969 -->Contacts<!-- /react-text --></em></div><ul class="_29hl" role="listbox" id=""><li role="option" class="_3h3c _5l37"><a href="#" tabindex="0" class="_5f0v"><div direction="left" class="clearfix"><div class="_ohe lfloat"><div class="_5l39 _5rmm"><div style="width: 32px; height: 32px;" class="_4ldz"><div style="width: 32px; height: 32px;" class="_4ld-"><img src="url" alt="" class="img" height="32" width="32"></div><div class="_4ld_ _2pom"><div class="_2pon _2poo"></div></div></div></div></div><div class=""><div class="_5l38 _42ef"><div class="_364g"><!-- react-text: 5094 -->name<!-- /react-text --><!-- react-empty: 5095 --></div></div></div></div></a></li></ul></div><div class="_29hk"><div class="_225b"><em data-intl-trid="" data-intl-translation="Businesses" class="_4qba"><!-- react-text: 5099 -->Businesses<!-- /react-text --></em></div><ul class="_29hl" role="listbox" id=""><li role="option" class="_3h3c _5l37"><a href="#" tabindex="0" class="_5f0v"><div direction="left" class="clearfix"><div class="_ohe lfloat"><div class="_5l39 _5rmm"><div style="width: 32px; height: 32px;" class="_4ldz"><div style="width: 32px; height: 32px;" class="_4ld-"><img src="url" alt="" class="img" height="32" width="32"></div><div class="_4ld_ _2pom"><div class="_2pon _2pop"></div></div></div></div></div><div class=""><div class="_5l38 _42ef"><div class="_364g"><!-- react-text: 5114 -->name<!-- /react-text --><!-- react-empty: 5115 --></div></div></div></div></a></li></ul></div><div class="_29hk"><div class="_225b"><em data-intl-trid="" data-intl-translation="More People" class="_4qba"><!-- react-text: 5049 -->More People<!-- /react-text --></em></div><ul class="_29hl" role="listbox" id=""><li role="option" class="_3h3c _5l37"><a href="#" tabindex="0" class="_5f0v"><div direction="left" class="clearfix"><div class="_ohe lfloat"><div class="_5l39 _5rmm"><div style="width: 32px; height: 32px;" class="_4ldz"><div style="width: 32px; height: 32px;" class="_4ld-"><img src="URL" alt="" class="img" height="32" width="32"></div><div class="_4ld_ _2pom"><div class="_2pon _2poo"></div></div></div></div></div><div class=""><div class="_5l38 _42ef"><div class="_364g"><!-- react-text: 5129 -->name<!-- /react-text --><!-- react-empty: 5130 --></div></div></div></div></a></li><li role="option" class="_5l37"><a href="#" tabindex="0" class="_5f0v"><div direction="left" class="clearfix"><div class="_ohe lfloat"><div class="_5l39 _5rmm"><div style="width: 32px; height: 32px;" class="_4ldz"><div style="width: 32px; height: 32px;" class="_4ld-"><img src="URL" alt="" class="img" height="32" width="32"></div><div class="_4ld_ _2pom"><div class="_2pon _2poo"></div></div></div></div></div><div class=""><div class="_5l38 _42ef"><div class="_364g"><!-- react-text: 5144 -->name<!-- /react-text --><!-- react-empty: 5145 --></div></div></div></div></a></li></ul></div></div>
but the moment i put it in the action designer it doesnt return correctly....

in regex it return perfect....

am i missing something here?

its returning MULTIPLE results that have no corilation to the reg ex...
action set to::

tag:div
attribute outer html
search type regex

result i wish to click
Код:
<div class="_364g"><!-- react-text: 5094 -->name<!-- /react-text --><!-- react-empty: 5095 --></div>
(class names will always change i want to grab the first result after contacts before "Businesses" or "more people')
 

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
Just regex the sorce with the code and put results in a click action... that works.

You would think though regex search action would work the same way though.... ? You would expect it to I thought....

Odd I need to add a step like that
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
This?
Код:
"Businesses" class="(.*?)".*?|"More People" class="(.*?)".*?
returns:
Код:
"Businesses" class="_4qba"
"More People" class="_4qba"
 

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
i want to click a action before hand. the solution was to reg ex the html
put the result in a varible,
then place that new varible into a click action....

cause you cant use the whole egex to parse out the result you wish to it seems...
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 772
Благодарностей
1 185
Баллы
113
If you regex out part of element you want to click, which I'm not sure why is needed at first place, but click will probably work if you use tag: a and attribute: outerhtml
Outerhtml holds all data about exact element.

For clicking, setting, getting best approach is to use action designer anyway.

Thanks
 

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
problem is the outers of stuff after "businesses" and "more friends" area can have exactly the same name and cause errors.
hens you have to tell it to reg ex BEFORE it. and you cant do that in action design

so using the BEST in action design does not apply
thanks
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)