from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from time import sleep # 实例化两个浏览器 driver_edge = webdriver.Edge() my_url = "https://www.douyin.com/" driver_edge.get(my_url) sleep(5) x=driver_edge.find_element(By.XPATH,'//*[@id="login-pannel"]/div[2]') x.click() sleep(10) search_box = driver_edge.find_element(By.XPATH,'//*[@id="douyin-header"]/div[1]/header/div/div/div[1]/div/div[2]/div/div/input').send_keys('50360824538',Keys.ENTER)