简体   繁体   中英

Selenium find a element with no class, div, text (Python)

I want to make a automatic google login with selenium but i cannot find the elements, the butto enter image description here n "Next", because the class is modified each time when we come to start a browser with selenium, or when we reset the login page and does not have Id, but the button is in a div that includes just this button, I would like someone to help me find a solution to find how I can use this button in order to click it to skip the page where you have to put your email address to skip to the password

i would like to use css selector

(Google Chrome the browser I use) I code with Selenium 4.2.0 on Linux Unbuntu

driver.find_element(By.CSS_SELECTOR, 'button[class="VfPpkd-LgbsSe VfPpkd-LgbsSe-OWXEXe-k8QpJ VfPpkd-LgbsSe-OWXEXe-dgl2Hf nCP5yc AjY5Oe DuMIQc LQeN7 qIypjc TrZEUc lw1w4b"]').click()

That will click the 'Next' button on Google login. Good luck getting any further though. Google seems to block logging in on Chromium.

You can either use jsname as an alternative for finding the element I found a similar question here How can I inspect element in to div with jsname? I think the person is doing pretty same thing Hope this helps:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM