Regex with variable in a value field

peterparker

Client
Регистрация
30.05.2013
Сообщения
20
Благодарностей
0
Баллы
0
Hi,

I try to get an click event on a link (the different search engine result pages of a search engine, for example from google or bing - blue links with numbers 1, 2, 3 ...).

At the moment I use
tag: a
attribute: innertext (there is no exclusive class or whatever to these links)
search type: regexp
value:{-Variable.whatever-} (the variable is a number, for example 2 or 3)
match: 0

It works, but as soons as there is another link on a serp with the current variable-number plus text in it of course it clicks the wrong link - not to the next serp but to one of the results above.

So is it possible to use regexp in the value field that only links that consist of 1 number (my variable) get clicked?

I tried something like {-Variable.whatever-}?, [^a-z]{-Variable.whatever-} but that does not seem to work.

Any suggestions how to use regex properly in this case?
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
If you are using a number for a variable, then I would suggest that you use that for the match#, not the attribute value or like you have noticed you can run into problems. The best thing I've found for Google is to use the Next>> or Next</span> as the search value. Then you don't have to worry about having counters or changing anything to accommodate hitting the link on each page. And who puts Next>> or Next</span> in their url.

Or you can see what the url is that the link is pointing to and use your counter or variable(whatever) in the search that way...ie http://bing\.com.*page={-Variable.whatever-} and just increment your counter for each page.
 

peterparker

Client
Регистрация
30.05.2013
Сообщения
20
Благодарностей
0
Баллы
0
Hi bigcajones,

thanks for your answer, thats a lot to think about.

1. match#
If I get it right (after reading this post http://zennolab.com/discussion/showthread.php?10349-Google-scraping-collecting-specific-number-of-results&highlight=match#) match# is the nr. of matches that the regex search provides? So in my case I would always need the last match# because the numbers are at the bottom of each SERP. Often it is match#0 because there is no other link with a number in it. But as soon as there is one other link I would not need match#0 but match#1 - right?

So is there a value to always click the last match# (I tried -1 but that does not work, higher numbers also do not work if there is only 1 result).

2. Next
Seems to be the easiest solution. But since there are no ">>" anymore, there is the possibility that the text "next" is in the link (for example for phrases like "next generation computing"). Not 100% safe but might be good enough for many different SERPs.

3. Counter with url
So in this case I would use the attribute "href" with the string "http://bing\.com.*page={-Variable.whatever-} " in the value field, right? Well, I will try that out as soon as possible.

4. Regex not possible
Besides your nice ideas - do you think regex in the value field (sorry, didnt understand how I could use my serp counter variable in the match# field) is possible and which style does it need to have. If I get your answer here http://zennolab.com/discussion/showthread.php?10055-about-the-action-design!&highlight=match# right it should be possbile.

BTW: Do you think the search engines need some mouse emulation to avoid being flagged as a bot?
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
1. match#
If I get it right (after reading this post http://zennolab.com/discussion/showt...light=match#) match# is the nr. of matches that the regex search provides? So in my case I would always need the last match# because the numbers are at the bottom of each SERP. Often it is match#0 because there is no other link with a number in it. But as soon as there is one other link I would not need match#0 but match#1 - right?
You can use word end for last match #
 

peterparker

Client
Регистрация
30.05.2013
Сообщения
20
Благодарностей
0
Баллы
0

kamazi

Client
Регистрация
16.10.2013
Сообщения
29
Благодарностей
0
Баллы
1

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
-1 cannot be used as number of match
 

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