How I force links to open in a new tab rather than new window in Puppeteer?

Hi

I really want to know How I force links to open in a new tab in Puppeteer ?

I was using a chrome extension in the past with OB1 and now unfortunately I can’t install chrome extensions in OB2

Have you tried this?

Unfortunately it didn’t work, I get an icon with arrows instead

Are you sure you’re clicking on the link? Please make sure. Otherwise I’ll give you some js code.

No I want to click on a button

<button type="button" class="create-account ant-btn ant-btn-dashed ant-btn-lg"><span>Create a new account</span></button>

When I use Ctrl+click I get the result that I want but I get so many errors in ob2 and less hits

also the new tab came with 0 index, weird right?

Hmmm I have no clue sorry

could you please share the js code to try it :slightly_smiling_face:

The code works for links, not buttons

That would be useful, I am trying to click in a href with no success

Parse the content of the href using a block (e.g. the get element attribute block) and then use Execute JS block (in interpolated mode) to run this script, which will open the link in a new tab

window.open("<PARSED_URL>", "_blank");
1 Like