Python 0.1:60753/devtools/browser/8cb1948b-10e1-46bd-ad25-e4fcf8ff49e6回溯(最近一次调用):文件“\collegboard_tsi_export.py”,第69行,在custom_report=Web

Python 0.1:60753/devtools/browser/8cb1948b-10e1-46bd-ad25-e4fcf8ff49e6回溯(最近一次调用):文件“\collegboard_tsi_export.py”,第69行,在custom_report=Web,python,selenium,selenium-webdriver,css-selectors,selenium-chromedriver,Python,Selenium,Selenium Webdriver,Css Selectors,Selenium Chromedriver,0.1:60753/devtools/browser/8cb1948b-10e1-46bd-ad25-e4fcf8ff49e6回溯(最近一次调用):文件“\collegboard_tsi_export.py”,第69行,在custom_report=WebDriverWait(浏览器,20)中。直到(EC.element_可点击((By.XPATH,//li[contains(@ng class,'customReports'))]/a[contains(@href,'customReports



0.1:60753/devtools/browser/8cb1948b-10e1-46bd-ad25-e4fcf8ff49e6回溯(最近一次调用):文件“\collegboard_tsi_export.py”,第69行,在custom_report=WebDriverWait(浏览器,20)中。直到(EC.element_可点击((By.XPATH,//li[contains(@ng class,'customReports'))]/a[contains(@href,'customReports'))]))文件“C:\Python38\lib\site packages\selenium\webdriver\support\wait.py”,第80行,直到引发TimeoutException(消息、屏幕、堆栈跟踪)selenium.common.exceptions.TimeoutException:Message:@R.Barrett签出更新的答案并让我知道状态。查看它。我已经用命名约定浏览器而不是驱动程序尝试了它。只是尝试了一下,仍然没有成功。我确实录制了一个selenium录制测试并将输出保存在这里@R.Barrett有一个更改,我在xpath和CSS选择器中,也让我知道状态。在收听ws://127.0.0.1:60753/DevTools/browser/8cb1948b-10e1-46bd-ad25-e4fcf8ff49e6 Traceback的
DevTools中添加了这些:文件“\collegboard\u tsi\u export.py”,第69行,在custom\u report=WebDriverWait(浏览器,20)中。直到(EC.element\u可单击)((By.XPATH,“//li[contains(@ng class,'customReports')]]/a[contains(@href,'customReports')]”)文件“C:\Python38\lib\site packages\selenium\webdriver\support\wait.py”,第80行,直到引发超时异常(消息、屏幕、堆栈跟踪)selenium.common.exceptions.TimeoutException:Message:
@R.Barrett签出更新的答案并让我知道状态。查看它。我已经用命名约定浏览器而不是驱动程序尝试了它。只是尝试了一下,仍然没有成功。我确实录制了一个selenium录制测试并将输出保存在这里@R.Barrett有一个更改,我在xpath和cssSelector中,让我知道状态。我尝试了以下方法,但我们使用了3个位置参数,而不是2个
PS C:\Users\richard.barrett\Git\ITDataServicesInfra\Python\Collegeboard\TSI>Python.\collegboard\u TSI\u export.py DevTools在ws://127.0.0.1:59923/DevTools/browser/49c4c813-8147-4d85-adae-41b08505936上侦听7回溯(最近一次调用last):文件“\collegboard\u tsi\u export.py”,第64行,在EC.element\u to\u be\u clickable(By.XPATH,//a[contains(@href,/customReports'))中,类型错误:\u init\u()接受2个位置参数,但给出了3个。
@R.Barrett您能用Java尝试上一个解决方案吗script@R.Barrett,因为我在手机上打字,所以我错过了那一行中的1()。现在你可以试试。我找到了解决方案
element=WebDriverWait(浏览器,20)。直到(EC.element可点击((By.LINK_TEXT,“Reports”))元素。点击();element=WebDriverWait(浏览器,20)。直到(EC.element可点击((By.LINK_TEXT,“自定义报告”))element。点击()
我不得不使用LINK\u text我尝试了以下方法,但我们使用了3个位置参数,而不是2个
PS C:\Users\richard.barrett\Git\ITDataServicesInfra\Python\Collegeboard\TSI>Python。\collegboard\u TSI\u export.py DevTools在ws://127.0.0.1:59923/DevTools/browser/49c813-8147-4d85-adae-41b059367回溯上侦听(最近一次调用last):文件“\collegboard_tsi_export.py”,第64行,在EC.element_to_be_clickable(By.XPATH,“//a[contains(@href,/customReports')”)中,TypeError:u init_uuuu()接受2个位置参数,但给出了3个
@R.Barrett您能用Java尝试最后一个解决方案吗script@R.Barrett,因为我在手机上打字,所以错过了1()在那一行。现在你可以试试。我找到了解决方案
element=WebDriverWait(浏览器,20)。直到(EC.element-to-be-clickable((By.LINK,TEXT,“Reports”))元素。click();element=WebDriverWait(浏览器,20)。直到(EC.element-to-be-be-clickable((By.LINK,TEXT,“自定义报告”))元素。click()
我必须使用LINK_text我最近重组了页面源代码和selenium录制的存储库:我最近重组了页面源代码和selenium录制的存储库:
                  <li ng-show="core.acl['244']!='N'" ng-class="{active:isLocation('/customReports')}">
                     <a href="#/customReports" translate='reports.CustomReports.title'></a>
                  </li>
#!/bin/python
# ===========================================================
# Created By: Richard Barrett
# Organization: DVISD
# DepartmenT: Data Services
# Purpose: Test Score & 3rd Party Website Data Pull Automation
# Date: 01/20/2020
# ===========================================================

import selenium
import os
import unittest
import requests
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select

#Variable Definitions NEED TO MAKE
#find_elements_by_name
#find_elements_by_xpath
#find_elements_by_link_text
#find_elements_by_partial_link_text
#find_elements_by_tag_name
#find_elements_by_class_name
#find_elements_by_css_selector


#URL Variables
login_url = 'https://www.accuplacer.org/'
redirect_url = 'https://www.accuplacer.org/api/home.html#/'
reports_scheduler_url = 'https://www.accuplacer.org/api/home.html#/reportScheduler'
custom_reports_url = 'https://www.accuplacer.org/api/home.html#/customReports'

#WebDriver Path
browser = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\chromedriver.exe")

#Parent URL
browser.get("https://www.accuplacer.org")

# Authentication
# Credentials NEEDS TO BE ENCRYPTED AND NOT BAKED INTO THE SCRIPT NEEDS UNIT TEST
username = browser.find_element_by_id("login")
password = browser.find_element_by_id("password")
username.send_keys("##############")
password.send_keys("##############")
#browser.send_keys(Keys.ENTER)
#browser.send_keys(Keys.RETURN)

# Work on Notifications Window Clause
# Need a step for when notifications appear to click "Submit" option
# <button type="button" ng-show="updateWhatsNewFlag == 'failure'" translate="submit" class="btn btn-sm btn-success ng-scope" ng-click="updateShowWhatsNewFlag()" style="">Submit</button>

# Need a step to close if the notification popup window is present
# <button type="button" class="btn btn-default ng-scope" data-dismiss="modal" ng-click="clearMessages()" translate="common.btn.close">Close</button>

# Authentication submit.click()
#browser.find_element_by_css_selector('.btn.btn-lg.btn-primary').click()
element = WebDriverWait(browser, 20).until(
        EC.element_to_be_clickable((By.CSS_SELECTOR, ".btn.btn-lg.btn-primary.pull-left")))
element.click();

#Navigate to CustomReports XPATH=//*[@id="leftNav"]/ul/li[11]/ul/li[9]/a
#browser.find_element_by_xpath('//*[@id="leftNav"]/ul/li[11]').click()


# Make the report by selecting objects
#obj_report = Select(browser.find_element_by_name("Reports"))
element = WebDriverWait(browser, 20).until(
        EC.element_to_be_clickable((By.CSS_XPATH, "*[@id="leftNav"]/ul/li[11]/ul/li[9]/a")))
element.click();
WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "li>a[href$='customReports'][translate*='CustomReports']"))).click()
WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.XPATH, "//li/a[contains(@href,'customReports') and contains(@translate, 'CustomReports')]"))).click()
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
element = WebDriverWait(browser, 20).until(
EC.element_to_be_clickable((By.XPATH, "//a[contains(@href, '/customReports')]")))
element.click();
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
element=browser.find_element(By.XPATH, "//a[contains(@href, '/customReports')]")
browser.execute_script("arguments[0].click();", element)
element = WebDriverWait(browser, 20).until(
        EC.element_to_be_clickable((By.LINK_TEXT, "Reports")))
element.click();

element = WebDriverWait(browser, 20).until(
                EC.element_to_be_clickable((By.LINK_TEXT, "Custom Reports")))
element.click();