https://sso.toutiao.com/login/?next=/&service=https://mp.toutiao.com/sso_confirm/?redirect_url=/
I am trying to reach the website above and automaticlly fill username using selenium and python.
it seems like that the login box is writing in Riot.js , I just can't find the username element in html, how can I automaticlly fill username using selenium ?
I am very new to selenium and Riot.js.
any help will be appreciated.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import pyperclip
import sys
chrome_options = webdriver.ChromeOptions()
prefs = {"profile.default_content_setting_values.notifications" : 2}
chrome_options.add_experimental_option("prefs",prefs)
browser = webdriver.Chrome(chrome_options=chrome_options)
browser.get("https://sso.toutiao.com/login/next=/&service=https://mp.toutiao.com/sso_confirm/?redirect_url=/")
mobile = browser.find_element_by_id("mobile")
code = browser.find_element_by_id("code")
mobile.send_keys("xxxxx")
code.send_keys("xxxx")
The username input seems to have CSS id
account
and xpath//*[@id="account"]
. This should be enough for selenium to access it: