How to capture with different numbers

Hello Ruri, i hope you can help with this question…lets go

When I am able to access the site correctly, sometimes it gives me 2-3 strings of numbers, each string of numbers gives me a different result, I wanted to know if it is possible and do the parse of the 3 strings of numbers, currently I can only do just with the first one, because I don’t know how to take the others and use them.

This is an example of what I get:
Number 1: ": 86778002388

Number 2: “:” 36098254588

Number 3: “:” 21546593265

If i use parse and recursive method, will capture like this:

86778002388, 36098254588, 21546593265

But the request to see the reponse source only accept one sequence number, like this:

https: / xxxxxxxxxxxxxxxxxxxxxxxxx / ? xxxxxx

I’m wondering if it is possible to divide what I capture in the parse and use each separate sequence, like this

https: / xxxxxxxxxxxxxxxxxxxxxxxxx / <NUMBER 1>? xxxxxx

https: / xxxxxxxxxxxxxxxxxxxxxxxxx / <NUMBER 2>? xxxxxx

https: / xxxxxxxxxxxxxxxxxxxxxxxxx / <NUMBER 3>? xxxxxx

When you capture recursively you are parsing a list.
If you called your list numbers you can then use the individual values like this

https://example.com/<numbers[0]>/xxx

0 for the first, 1 for the second etc.

2 Likes

Thanks Ruri, solved my problem.

Sorry to bring this up. I’m trying this but I’m getting an error:

BLOCK:HttpRequest
  url = "https://www.samplesite.org/"
  TYPE:STANDARD
  $""
  "application/x-www-form-urlencoded"
ENDBLOCK

BLOCK:Parse
  input = @data.SOURCE
  leftDelim = "<span>"
  rightDelim = "</"
  RECURSIVE
  MODE:LR
  => VAR @pop
ENDBLOCK

BLOCK:ConstantList
  value = $["<pop[*]>"]
  => VAR @constantListOutput
ENDBLOCK

I end up with this error:
chrome_8EF1X2Htqt

But if I do:

BLOCK:ConstantList
  value = $["<pop[1]>"]
  => VAR @constantListOutput
ENDBLOCK

Something shows up. How can I show all the recursively parsed items? Instead of doing them 1 by 1.

This is not valid OB2 syntax $["<pop[*]>"]
The pop variable is already a list if you use recursive mode, why are you trying to make it a list once again?

@Ruri I have a question, lets say I got more than 3 values parsed recursively and I want to implement them in one single request, is that possible?
These are my values for instance: [123, 456, 789, 000]
So I want the request to repeat itself depending on how much values parsed earlier. So in that case I get all the responses from each one using one request only

One request = one response. You cannot have multiple responses from 1 request. You need to use a FOR EACH loop and loop over your parsed values to make 1 request for each of them. Maybe provide some example of what you mean by “one request” if you think I misunderstood you. @AINTHATEASY

No, you got the point, what I want is each value has to be in a HTTP Request so then I can parse what I need from each of them.

I think the first post in this thread will be useful to you

1 Like

So how do I make that possible? I want to use the FOR EACH loop to create requests for example for the three values I parsed but not necessarily always three values it could be four, five or more.

Did you read the post I linked? The problem that is addressed there is exactly the one you are facing right now. You don’t need to know the length of your parsed list, it could be 1000 items and it would still be the same.

1 Like

I’m checking it out.

I see, so you don’t have to clone the request block but you will make it repeat itself in the debugger instead with the values you want to put right?

Yes exactly, it will loop for as many times as the length of the list that you give it. Just follow the example, you can’t go wrong.

1 Like