Issue: Unable to locate element with the specified selector: #email

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://discord.com/register');
  await page.screenshot({path: 'b.png'});
  await page.click('#email');
  await page.keyboard.sendCharacter('EMAIL');
  //await page.type('#email', 'World', {delay: 100});
  //await page.type('#username', 'World', {delay: 100});
  //await page.type('#password', 'World', {delay: 100});
  await page.screenshot({path: 'example.png'});
  await browser.close();
})();

this code snippet is specifically for the webpage. Despite the field being labeled as "email," it seems to be missing.

Answer №1

#email targets an element that has the id="email". This is the Email input field:

<input class="inputDefault-_djjkz input-cIJ7To" name="email" type="email" placeholder="" aria-label="Email" maxlength="999" value="">

No ID attribute is present here, what you need to use is name="email". So, you can refer to it like this:

page.click("[name='email']")

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 way to keep the textfield value at 0? If you clear the textfield, it will result in another value being

If I don't input anything in this field, the total will show as isNaN, and I want to prevent form submission if it is isNaN. How can I stop the form from being submitted when the total value is isNaN? export default function BasicTextFields() { cons ...

Select any menu option to return to the one-page layout and then scroll down to find the location

I'm wondering if there is a way to navigate back from an external page to a specific section on my one-page website with a fixed menu? On my one-pager website, I have a fixed menu that includes a "apply for a job" button. When clicked, it takes users ...

Numerous invocations of express middleware functions

Currently, I am in the process of developing an app with express and have created a function to set a language cookie. [..] app.use(cookieParser()); app.use(function(req, res, next) { if(req.cookies.lang === undefined){ console.log(req.cookies); ...

Canvas 'toDataURL' Execution Error Occurs with Angular Dynamic Routing

For my Web application, I am using AngularJS on top of Node/Express. One of the routes in my application has an HTML5 canvas which I convert to an image. When I navigate to that route directly with this code, there are no problems with converting the canva ...

Attempting to modify the key values within an object, however, it is mistakenly doubling the values instead

I'm encountering an issue when trying to update key values within an object. It seems to be adding duplicate values or combining all values together instead of assigning each name a specific language slug. I can't figure out where I'm going ...

Optimizing jQuery scripts by consolidating them to reduce file size

I've created a jQuery script that performs the same task but triggers on different events, including: Page load Dropdown selection change Clicking the swap button Typing in a text field However, I had to write separate scripts for each of these eve ...

An error was encountered while attempting to utilize Google's Core Reporting API: Uncaught SyntaxError: Unexpected token <

I've been experimenting with Google's Core Reporting API and successfully implemented their provided demo. Now, I'm trying to integrate the code into my own project. My main tech stack includes AngularJS and PHP. I aim to keep it simple by ...

Connecting CSS styles and images to my EJS templates on a distant Express server using Node.js (Ubuntu 18.04)

I have been hunting for a solution here extensively, but every attempt has failed. So, here's the issue I'm facing: I have created a basic Express server locally to display a static page until I finish full integration. The structure of my site ...

Issue: Unspecified error when trying to access object attribute in Vue (Nuxt)

I am facing an issue with my 'region' object. It appears to be displayed correctly with all its attributes, but when I try to access specific attributes, it shows up as 'undefined'. const region = { "id": 7, "name": ...

Using a function as a prop in Vue js to retrieve data from an API

I am facing an issue with a component that I want to decouple from the data fetching implementation. My goal is to be able to pass a data fetching callback as a prop. The reason for this is so that I can easily mock the data fetching process in storybook. ...

Is it acceptable to post variables using AJAX for processing?

Is there a way to send data with AJAX using the code provided? It seems like the information is not being sent to the PHP file as intended. Here is the code snippet: $('#send').click(function(){ var pseudo = $('#psd').val(); }) ...

How can I manage asynchronous calls when querying Mongoose for each element in an array using Express?

Having trouble with the post method below because of a mongoose async issue. The code res.send(suggestions) is being executed before Expense.findOne.exec. app.post('/suggestions', async function(req, res) { const suggestions = await req.body ...

Steps for storing div content (image) on server

Currently in the process of developing a web application that allows users to crop images. The goal is for users to have the ability to email the URL so others can view the cropped image, ensuring that the URL remains active indefinitely by storing every c ...

Utilizing AJAX to showcase an HTML popup

I am currently working on a project to create an HTML page that will display another HTML file in an alert when a button is pressed. However, I am facing an issue where the content is not being displayed as expected. <html> <head> ...

What causes the parent element's click event to trigger on its own when a child textbox is clicked or focused in Safari?

Describing my HTML setup [Checkbox] [Text] [Input element (Display if check-box is marked)] <span class='spGrpContainer'> <label id='stepGH_Group1' class='lblStep GHSteps lblGroupheader' stepid='1' st ...

When using expressjs and typescript, you may encounter an error stating that the type 'typeof <express.Router>' cannot be assigned to the parameter type 'RequestHandlerParams'

Working on my project using expressjs with the latest typescript definition file and typescript 2.3.4 from https://github.com/DefinitelyTyped/DefinitelyTyped. I've set up a router and want to access it from a subpath as per the official 4.x documentat ...

Utilizing Node Js and Socket.Io to develop a cutting-edge bot

Is it possible to run JavaScript with Node.js without launching Google Chrome from various proxies? Can someone provide a sample code for this task? For example, you can find a similar project here: https://github.com/huytd/agar.io-clone Another project c ...

Mapping a structure from a buffer in C using a pointer and casting techniques

In programming with C, I have the ability to create various structures and even structures of structures. By setting a pointer in a buffer at the start of a structure, I can signify that this buffer represents the structure. Naturally, I prefer mapping ov ...

Is there a way to merge these arrays into a single array?

With the current code I am obtaining numerous JSON objects within separate arrays: Here is the code snippet: for (let i=1; i<=150;i++){ fetch(`A valid URL ${i}`) .then(result => result.json()) .then(result => console.log(result.data.results)) ...

I am encountering an issue where the object I am sending with Next.js is appearing as undefined on the receiving page

When transferring data from my question screen to a result screen, I am using an object called footprintsData. Here is the code snippet for sending the data: const footprintsData = { carFootprint: roundedCarFootprint, electricityFootprint: roundedElect ...