driver=webdriver.Chrome()driver.maximize_window()driver.get("website")driver.find_element_by_id("email").send_keys("email@email.com")driver.find_element_by_id("password").send_keys("password123")driver.find_element_by_id("submit").click()driver.get("website2")driver.implicitly_wait(30)driver.find_element_by_id("ui-id-6").click()day=driver.find_element_by_xpath("/html/body/main/div[2]/div[6]/div[3]/div[4]/div/div[2]/table/tbody/tr[1]/td[2]")ActionChains(driver).move_to_element(day).click().perform()WebDriverWait(driver,60).until(EC.presence_of_element_located((By.XPATH,"/html/body/main/div[2]/div[6]/div[3]/div[4]/div/div[2]/table/tbody/tr/td/ul/li[2]/h3/a[3]")))driver.execute_script("window.scrollBy(0,500)","")driver.find_element_by_xpath('/html/body/main/div[2]/div[6]/div[3]/div[4]/div/div[2]/table/tbody/tr/td/ul/li[2]/h3/a[3]').click()driver.find_element_by_xpath('/html/body/main/div[2]/div[6]/div[3]/div[2]/form/div[3]/ul[1]/li[3]/i').click()driver.find_element_by_xpath('/html/body/main/div[2]/div[6]/div[3]/div[2]/form/div[3]/ul[1]/li[2]/i').click()driver.find_element_by_xpath('/html/body/main/div[2]/div[6]/div[3]/div[2]/form/div[3]/ul[1]/li[1]/i').click()driver.find_element_by_id('scheduleDate').click()day=driver.find_element_by_xpath('/html/body/div[4]/table/tbody/tr[5]/td[2]/a')ActionChains(driver).move_to_element(day).click().perform()driver.implicitly_wait(30)driver.execute_script('window.scrollTo(0, document.body.scrollHeight)')img=driver.find_element_by_xpath('/html/body/main/div[2]/div[6]/div[3]/div[2]/form/div[2]/div/div[3]/div[1]/button[2]')ActionChains(driver).move_to_element(img).click().perform()driver.find_element_by_xpath('/html/body/main/div[2]/div[6]/div[4]/div/div[2]/div/ul/li/div[1]/img').click()driver.execute_script('window.scrollTo(0, 500)')driver.find_element_by_id("quickpostHashTag").send_keys("tags",(Keys.RETURN))driver.find_element_by_id("calendarTitle").clear()driver.find_element_by_id('calendarTitle').send_keys('title')driver.find_element_by_id('calendarMessage').clear()driver.find_element_by_id('calendarMessage').send_keys("msg")driver.implicitly_wait(30)driver.execute_script('window.scrollTo(0, document.body.scrollHeight)')driver.find_element_by_xpath('/html/body/main/div[2]/div[6]/div[3]/div[2]/form/div[4]/a').click()driver.execute_script('window.scrollTo(0, document.body.scrollHeight)')driver.find_element_by_xpath("/html/body/main/div[2]/div[6]/div[3]/div[2]/div/div[3]/div/button[1]").click()driver.close()
python自动化脚本效率_Web自动化脚本效率
最新推荐文章于 2021-03-01 06:28:38 发布