What is the method for retrieving the destination URL of a dropdown item using Puppeteer?

My challenge is to identify the destination URL for the "Edit" option in a dropdown menu using Puppeteer. Is there a specific method to obtain this URL through Puppeteer?

<div _ngcontent-c34="" class="dropdown-menu" ngbdropdownmenu="" x-placement="bottom-right" style="top: 19px; left: -41px;">
<!---->
<i _ngcontent-c34="" class="dropdown-item ng-star-inserted" ngatranslatedtext="" tabindex="0">Edit</i>
<!---->
<i _ngcontent-c34="" class="dropdown-item ng-star-inserted" ngatranslatedtext="" tabindex="0">Delete</i>
</div>

Answer №1

Retrieve and assign the URL of the new page.

  page.on('newpage', async (new_page) => {
        const url = new_page.url;
});

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best method for incorporating a unique style to a v-dialog component in Vuetify following the most recent update?

I'm currently working on a project using vuetify, and I am facing an issue while trying to add a custom class to a v-dialog component. I have tried searching for information on how to do this, but it seems that the prop "content-class" has been deprec ...

Getting the right AngularJS $scope within a controller for beginners

I am struggling to understand how to toggle the visibility of an element on a webpage using a controller. Below is a code snippet with an example - you can test it by clicking the "close edit" button (nothing happens): var appModule = angular.module(&a ...

Explore the scope of each item in ng-repeat

My table has rows that use their respective scope variables for conditional rendering: <tr ng-repeat="row in data"> <input type="text" data-ng-show="editMode" data-ng-model="row.smth"/> The input is only shown when the row's scope vari ...

Make sure to employ Bootstrap's justify-content-between and stack-to-horizontal col correctly

I am currently working on a responsive form that contains 1 label, 1 input field, and 5 buttons. Both the buttons and the input field are located under col-8. The positioning I aim for the buttons is as follows: They should start below and align with ...

Is there a way to dynamically incorporate line numbers into Google Code Prettify?

Having some trouble with formatting code and inserting/removing line numbers dynamically. The line numbers appear on the first page load, but disappear after clicking run. They don't show at all on my website. I want to allow users to click a button a ...

What is the process for including .php and .js files within WordPress?

Seeking guidance from experienced WordPress users! I am a PHP expert trying to integrate .php files into WordPress using the Visual Editor. My aim is to validate HTML forms by utilizing Ajax calls to these scripts. Although proficient in PHP and various ...

Questions about clarifying JS promises and async-await functions

After doing some reading on promises in JavaScript, I have come across conflicting information which has left me with a few basic questions. I have two specific questions that need clarification: Is it necessary for every function in JavaScript to be ca ...

Angular 14 debug error: Incorrect base path setting

Whenever I go for a run, I have to specify a starting point such as /pis/ ng serve --serve-path /pis/ Even after following these instructions, nothing seems to load. Can anyone lend a hand with setting a starting point in the ng serve process? ...

Guide to converting a two-dimensional square matrix stored as a one-dimensional array in JavaScript

My inquiry is similar to the one linked below, however, I am seeking a solution using JavaScript How to Transpose 2D Matrix Stored as C 1D Array In essence, I have a square matrix in two dimensions 1 2 3 4 5 6 7 8 9 This matrix is stored like this let ...

Toggle the visibility of elements (such as a form) with a click of a link - Utilize ajax to

I'm attempting to use jQuery to toggle the visibility of a form. This functionality is triggered by clicking on a specific link... The goal is to hide all links with data-action="edit" and only display the form that follows the clicked link, as there ...

How can you utilize jQuery to iterate through nested JSON and retrieve a specific matching index?

In the scenario where I have a nested JSON object like this: var library = { "Gold Rush": { "slides": ["Slide 1 Text","Slide 2 Text","Slide 3 Text","Slide 4 Text"], "bgs":["<img src='1.jpg' />","","<img src='2.j ...

Selenium WebDriver Error: Element not found - Element could not be located

Having an issue with clicking on a button that has CSS styling. The code for the button is as follows: <div id="rightBtn"> <input type="submit" class="mainButton" id="dodajTrenera" value="Dodaj" name="dodaj_trenera"> </div> To perform t ...

The integration of jQuery Masonry with margin-right for a seamless and

I have a row with two columns, where the first column has a right margin and the second one does not. I would like to use jQuery Masonry to eliminate any empty spaces. However, it seems that the margin right does not interact well with Masonry. Is there a ...

Struggling with TypeScript declaration files has been a challenge for me

I'm encountering an issue with using the trace function in my TypeScript code. The function has been declared in a .d.ts file as shown below: declare function trace(arg: string | number | boolean); declare function trace(arg: { id: number; name: strin ...

What is the proper method for changing the height of this component in HTML?

Hey there! I'm brand new to HTML and I'm embarking on a little project for myself to enhance my skills. I have a question about adjusting the height of some text - I want it to look similar to Twitter, where each "tweet" is clearly separated from ...

What is the reason behind the array.push() method not altering the array?

Here's the challenge: Eliminate all falsy values from a given array. Falsy values in JavaScript include false, null, 0, "", undefined, and NaN. Tips: Try converting each value to a Boolean. Below is my attempt at solving it: function bouncer(a ...

What is the best way to confirm that a SQL pool has been successfully created in an Express JS?

Currently, I am in the process of developing a restful API using mysql and expressjs. Below is an example showcasing how I send requests to my database: server.js: const express = require('express'), bodyParser = require('body-parser&ap ...

Sliding Tab Animation using solely CSS on Flexbox

I've been challenged with developing my own React Tabs component that includes a sliding animation, similar to what you see in mui or ant design. I can achieve this using JavaScript, however, the limitation is that I cannot use CSS within JavaScript ...

Deliver a message using a loop in jade

I'm struggling with posting a request in Node and Jade using a specific ID. For instance, if Node returns a list of books : res.render('tests', {books: books}); In my Jade template, I display all the books by iterating through them. b ...

Issues arise when attempting to utilize jQuery to print a string once a button is pressed

I am trying to display a string on the webpage when the user clicks a button. Below is the HTML code: <p> <h1 class="text-center" id="notif"> </h1> </p> Here is the relevant part of the script: $("#btn_My").click(functio ...