RahulShaw / LinuxAcademy-DL

Download videos from your LinuxAcademy account for offline viewing
MIT License
65 stars 44 forks source link

AttributeError: 'NoneType' object has no attribute 'text' #22

Closed SriRamTKS closed 4 years ago

SriRamTKS commented 4 years ago

Requesting download of https://linuxacademy.com/cp/modules/view/id/341

DevTools listening on ws://127.0.0.1:4819/devtools/browser/234768c0-a00f-425e-9e95-a69d8b9fce56 Sleeping for 15 seconds.. Attempting to login.. Login successful... Getting lesson links... Traceback (most recent call last): File "driver.py", line 85, in title = parsed_html.find('span', attrs={'class', 'course-title'}).text AttributeError: 'NoneType' object has no attribute 'text'

SriRamTKS commented 4 years ago

I tried with the below 2 courses and I receive the exact same error: https://linuxacademy.com/cp/modules/view/id/341 https://linuxacademy.com/cp/modules/view/id/280

I do have an active subscription, and I'm not behind a firewall or VPN. I'm using the latest version of Chrome.

The browser page navigates to the course page, and stays there when this error occurs in the console.

I do see that a couple of other issues talking about this error, but no confirmed resolution was mentioned anywhere. So, I opened this one.

Please advise.

bi7je commented 4 years ago

On line 85 (i think) you will find this like:

title = parsed_html.find('span', attrs={'class', 'course-title'}).text Change that to: title = ["course title"] in quotes without the brackets and it should work. Example: title = "AWS Certified Solutions Architect – Associate Level"

Make sure to edit the title to not contain iligal folder name characters for your OS .

SriRamTKS commented 4 years ago

Awesome. Works perfectly now. Thank you!

Looking at the code, I understand that the spanelement is no more in the source. Your solution is the simplest to get going.

Thanks again for this great solution.