Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

key error "Elements #29

Open
kahisfz opened this issue Sep 12, 2019 · 4 comments
Open

key error "Elements #29

kahisfz opened this issue Sep 12, 2019 · 4 comments

Comments

@kahisfz
Copy link

kahisfz commented Sep 12, 2019

I am getting this error,
File "linkedin_learning.py", line 222, in process
await fetch_courses()
File "linkedin_learning.py", line 102, in fetch_courses
return await asyncio.gather(*map(fetch_course, COURSES))
File "linkedin_learning.py", line 112, in fetch_course
course = build_course(data['elements'][0])
KeyError: 'elements'

@kahisfz kahisfz closed this as completed Sep 12, 2019
@kahisfz
Copy link
Author

kahisfz commented Sep 12, 2019

I sorted the things again and able to get chapter list only but no video
the error on screen is as;
Traceback (most recent call last):
File "linkedin_learning.py", line 234, in
loop.run_until_complete(process())
File "C:\Users\Kashif\AppData\Local\Programs\Python\Python36\lib\asyncio\base_events.py", line 466, in run_until_complete
return future.result()
File "linkedin_learning.py", line 222, in process
await fetch_courses()
File "linkedin_learning.py", line 102, in fetch_courses
return await asyncio.gather(*map(fetch_course, COURSES))
File "linkedin_learning.py", line 116, in fetch_course
await fetch_chapters(course)
File "linkedin_learning.py", line 128, in fetch_chapters
await asyncio.gather(*chain.from_iterable(fetch_chapter(course, chapter) for chapter in course.chapters))
File "linkedin_learning.py", line 139, in fetch_video_or_wait
await fetch_video(course, chapter, video)
File "linkedin_learning.py", line 165, in fetch_video
video_url = data['elements'][0]['selectedVideo']['url']['progressiveUrl']
KeyError: 'url'

@kahisfz kahisfz reopened this Sep 12, 2019
@kahisfz
Copy link
Author

kahisfz commented Sep 12, 2019

I sorted the things again and able to get chapter list only but no video
the error on screen is as;
Traceback (most recent call last):
File "linkedin_learning.py", line 234, in
loop.run_until_complete(process())
File "C:\Users\Kashif\AppData\Local\Programs\Python\Python36\lib\asyncio\base_events.py", line 466, in run_until_complete
return future.result()
File "linkedin_learning.py", line 222, in process
await fetch_courses()
File "linkedin_learning.py", line 102, in fetch_courses
return await asyncio.gather(*map(fetch_course, COURSES))
File "linkedin_learning.py", line 116, in fetch_course
await fetch_chapters(course)
File "linkedin_learning.py", line 128, in fetch_chapters
await asyncio.gather(*chain.from_iterable(fetch_chapter(course, chapter) for chapter in course.chapters))
File "linkedin_learning.py", line 139, in fetch_video_or_wait
await fetch_video(course, chapter, video)
File "linkedin_learning.py", line 165, in fetch_video
video_url = data['elements'][0]['selectedVideo']['url']['progressiveUrl']
KeyError: 'url'

@appinteractive
Copy link

Any luck?

@awachiuri
Copy link

did this error ever got resolved?
how did you resolve key error elements?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants