OB2 Puppeteer click not working

Hi

BLOCK:PuppeteerOpenBrowser
ENDBLOCK

BLOCK:PuppeteerNavigateTo
  url = $"http://www.url.br/busca?termo=<input.cpf>"
  referer = "http://www.url.br/"
ENDBLOCK

BLOCK:PuppeteerGetAttributeValue
  identifier = "resultados"
  => CAP @puppeteerGetAttributeValueOutput
ENDBLOCK

BLOCK:Parse
LABEL:try-store-path-link-first-click-to-page 1
  input = @data.SOURCE
  leftDelim = "<h4 class=\"busca-portal-title-text-1\"><a href=\""
  rightDelim = "\">Pessoa"
  attributeName = "href"
  xPath = "//*[@id=\"resultados\"]/div/h4/a"
  MODE:LR
  => CAP @pathfirstclick
ENDBLOCK

BLOCK:PuppeteerClick
LABEL:try Click page 1
  findBy = XPath
  identifier = "//*[@id=\"resultados\"]/div/h4/a"
ENDBLOCK

BLOCK:Parse
LABEL:try-store-path-link-first-click-to-page 2
  input = @data.SOURCE
  leftDelim = "<a id=\"btnDetalharBpc\" class=\"box-ficha__botao_editado\" href=\""
  rightDelim = "\">Detalhar</a>"
  attributeName = "outerhtml"
  xPath = "//*[@id=\"btnDetalharBpc\"]"
  RECURSIVE
  MODE:XPath
  => CAP @pathdetalhes
ENDBLOCK

Here is the log result

Sliced value into:

cpf: value

Open Browser (PuppeteerOpenBrowser) <<

Headless Browser opened successfully!

Navigate To (PuppeteerNavigateTo) <<

Navigated to http://www.url.br/busca?termo=value

Get Attribute Value (PuppeteerGetAttributeValue) <<

Got value —heredisplaytheresult–

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

try-store-path-link-first-click-to-page 1 (ParseBetweenStrings) <<

Parsed value:

Variable pathfirstclick marked for capture

try Click page 1 (PuppeteerClick) <<

Clicked 1 time(s) with Left button

try-store-path-link-first-click-to-page 2 (QueryXPathRecursive) <<

Parsed 0 values:

Variable pathdetalhes marked for capture

BOT ENDED AFTER 4893 ms WITH STATUS: NONE

I’ve copied the XPATH directly from chrome, also tried to use LR but it ins’t working
In order to test I also tried to parse the href content link in hope that I can capture but no success, is like the click doesn’t are loading

Someone know what is going on?

Yes, the click in the puppeteer does not work, why ruri?

Is it inside an iframe? Please check. If it is, you need to switch to the iframe context first.

How can this be verified?

Hope the way that I used work for you

// BLOCK: First get your link by path and store in string

data.ExecutingBlock("First get your link by path and store in string");

string yourstring = await PuppeteerGetAttributeValue(data, RuriLib.Functions.Puppeteer.FindElementBy.XPath, "yourxpath", 0, "href").ConfigureAwait(false);

data.MarkForCapture(nameof(yourstring));

// BLOCK: Navigate to string result

data.ExecutingBlock("Navigate To");

await PuppeteerNavigateTo(data, $"{yourstring}", PuppeteerSharp.WaitUntilNavigation.Load, "url", 30000).ConfigureAwait(false);

How can this be verified?

If it is inside frame should have <iframe>
The thing is: for some reason the BLOCK CLICK really won’t work.

I didn’t pay much attention until I really needed it, but the click and submit functions are really essential

Also, BLOCK SUBMIT is having same issue.
If you need use click or submit I found these ways:

Use Execute JS block instead click:

Expression: document.getElementById("elementid").click();

Use Execute JS block instead submit:

Expression: document.getElementById("elementid").submit();

If you need click a link you can get href by get element and call it on URL input in navigate block

Don’t forget change ID to match with what you need
If you discover issues don’t forget report so admin can fix it in further

I will report this issue with details soon in Github, need create my account first.

Not work bro :pensive: :innocent: :innocent: :innocent:

Share your config in PM so I can take a look

Check your PM, I sent your working code