I am trying to login to my comcast account using selenium but its not pressing "sign in" button properly. What it does is, it just redirects you back to the old email page (it also removes the email typed in the input). I have tried waiting implicitly, waiting for button to be clickable, etc.
I have tried the same thing in Node.js with puppeteer and it works as expected.
Python code:
driver.get("https://login.xfinity.com/login")
driver.implicitly_wait(5)
driver.find_element_by_css_selector("#user").send_keys(email Keys.ENTER)
# there is more code but it can't even get pass the first email step
Node.js code:
await page.goto("https://login.xfinity.com/login");
await page.waitForTimeout(3000);
await page.type("#user", email);
await page.click("#sign_in");
await page.waitForTimeout(3000);
await page.type("#passwd", password);
await page.click("#sign_in");
await page.waitForTimeout(3000);
CodePudding user response:
I suggest to wait at least 1 second after you type the password. This mimic human behavior - you type the password, wait a bit and then press the submit button.
await page.goto("https://login.xfinity.com/login");
await page.waitForTimeout(3000);
await page.type("#user", email);
await page.click("#sign_in");
await page.waitForTimeout(3000);
await page.type("#passwd", password);
// wait 1 second after typing the password
await page.waitForTimeout(1000);
await page.click("#sign_in");
await page.waitForTimeout(3000);
CodePudding user response:
Maybe you're not referencing the object properly. There is a Firefox extension, TruePath. You can get the path to any object from that extension.
