helper.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:TestRewrite 作者: osqa-interns 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号