How to find the css selector in chrome
Why Stack Overflow recommends it
Stack Overflow users link it when answering Selenium, Puppeteer and XPath questions where the asker needs a quick way to get or verify an element's selector in Chrome.
Recommended by 2 people across 2 different months, 2018 to 2020.
What it is
A roughly one-minute screen-capture tutorial showing how to find and copy a CSS selector for an element using Chrome's Developer Tools. It is a short how-to uploaded by the channel Sagar S (Vishal).
What people said
Recommends Frank · 2018-03 · Stack Overflow · on “Element cannot be sent to a field, website login, Python + Selenium”
For the Button not being clicked, there are two possible reasons making your script fails. Timing: I suppose that the button is disabled until both email and password are filled. That makes that you have to wait till the button is enabled. To test if this is the reason of failure you can put sleep just before clicking on the button. Your locator is not unique: Did you check using, for instance, Chrome Developer tools that your locator for the submit button is unique? If not, another element (not visible on your page) is maybe clicked. How to do this you can learn here: [this video] .
Recommends user13512949 · 2020-05 · Stack Overflow · on “How and by use of which locator should I use to automate main and sub-elements from left navigation in any site?”
I would suggest you to read any articles or watch any free tutorials e.g. copy selector in chrome [this video] But what you can do right now is to try to modify your long Xpath by adding unique classNames or id or ... Of course would be great to see your problem, for example a piece of code with DOM elements from where you trying to get your Xpath
Cites Neibesh · 2020-02 · Stack Overflow · on “How to get speciffic element to <dl> using querySelector in puppeteer”
True, it will return null if it is unable to find the element, have you tried this at all to just check that your selector path hasn't changed at all for the element you are trying to select? [this video]