def get_course_list(self, closed=False):
"""
Return a list of available courses.
ToDo: go to a closed course
"""
print(self.current_url())
'''print(
self.driver
.find_element(By.ID, 'ox-react-root-container')
.get_attribute('outerHTML')
)'''
self.wait.until(
expect.visibility_of_element_located(
(By.TAG_NAME, 'h1')
)
)
courses = self.find_all(
By.CSS_SELECTOR,
'.my-courses-current-section .my-courses-item'
)
if len(courses) == 0:
print('No courses found: %s' % courses)
return []
for position, course in enumerate(courses):
print('%s : "%s"' % (position, course.get_attribute('data-title')))
return courses
评论列表
文章目录