Automate data scrape OB2 puppeteer

trying to solve this problem handle-interactions-json-and-error-page from another approach

I am capturing this element:

// BLOCK: Open Browser

data.ExecutingBlock("Open Browser");

await PuppeteerOpenBrowser(data).ConfigureAwait(false);

// BLOCK: Navigate To

data.ExecutingBlock("Navigate To");

await PuppeteerNavigateTo(data, "http://www.URL.br/busca?termo=value", PuppeteerSharp.WaitUntilNavigation.Load, "http://www.url.br/", 30000).ConfigureAwait(false);

// BLOCK: Get Attribute Value
data.ExecutingBlock("Get Attribute Value");
string puppeteerGetAttributeValueOutput = await PuppeteerGetAttributeValue(data, RuriLib.Functions.Puppeteer.FindElementBy.Id, "resultados", 0, "innerText").ConfigureAwait(false);
data.MarkForCapture(nameof(puppeteerGetAttributeValueOutput));


Result:

Got value test
of attribute innerText by executing document.querySelectorAll(‘#resultados’)[0].innerText;
Variable puppeteerGetAttributeValueOutput marked for capture

In OB1 we should use in URL the wordlist string, as this example:

http://www.URL.br/busca?termo=<value>
where value will be replaced with wordlist
how to use this string in OB2?

I need a block to close browser on end of my stacker?

Thanks

Update:

  • Added a new wordlist type in Environment.ini
  • Added a input.examplevaluetype in URL in order to try get value replaced when fire request

Log Results

Sliced examplevalue into:
examplevalue: examplevalue
>> Open Browser (PuppeteerOpenBrowser) <<
Headless Browser opened successfully!
>> Navigate To (PuppeteerNavigateTo) <<
Navigated to http://www.url.br/busca?termo=input.exampletypevalue
>> Get Attribute Value (PuppeteerGetAttributeValue) <<
Got value of attribute innerText by executing document.querySelectorAll('#resultados')[0].innerText;
Variable puppeteerGetAttributeValueOutput marked for capture
BOT ENDED AFTER 4518 ms WITH STATUS: NONE

Still do not replacing the input.cpf with value from data test

[WORDLIST TYPE]
Name=Cpfteste
Regex=^[0-9]*$
Verify=True
Separator=
Slices=exampletypevalue

EDIT:

Done, the solution was <input.exampletypevalue>

Did you read this guide? Comprehensive guide to Wordlist Types

Thank for you waste time answering me.
I started doing it before reading but I found it in the guides section, however, as I first learned to use OB1.4.4 it was not clear how to call the value as we need use input. before the string

The guide shows how to create a wordlist, define slices, until upload but is missing an example that how call the data string in practice, maybe is helpfull add this information

Sorry, this was my first hours with openbullet, still need a lot of time to really learn
Congratulations for your amazing work, by the way, you probably see saw my other topic with 1.4.4 , do you know if I can get data in that way?

There’s definitely a logical reason it doesn’t work
Thanks bro :money_mouth_face:

In the guide, I wrote this

You will then be able to use input.USERNAME and input.PASSWORD in your config in order to access those pieces of data

you can check if you want :slight_smile:

Thank you :heart:
Sadly I do not support OB1 anymore, so please switch to OB2 otherwise I will not be able to help you!

1 Like