Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting an AttributeError: 'NoneType' object has no attribute 'group' #45

Open
bayramj opened this issue Aug 21, 2022 · 2 comments
Open

Comments

@bayramj
Copy link

bayramj commented Aug 21, 2022

After creating the cookie.txt file and compiling I get the following error message:

Traceback (most recent call last):
File "C:\Users\Julian\Desktop\chegg\Downloader.py", line 3, in
Downloader.main()
File "C:\Users\xxxx\Desktop\chegg\cheggscraper\Downloader.py", line 40, in main
print(Chegg.url_to_html(args['url'], file_name_format=args['file_format']))
File "C:\Users\xxxxx\Desktop\chegg\cheggscraper\CheggScraper.py", line 521, in url_to_html
headers, heading, question_div, answers__, question_uuid = self._parse(html_text=html_res_text,
File "C:\Users\xxxxx\Desktop\chegg\cheggscraper\CheggScraper.py", line 437, in _parse
re.search(r'C.page.homeworkhelp_question((.*)?);', html_text).group(1))
AttributeError: 'NoneType' object has no attribute 'group'

Please let me know if there is a solution for this or if this is now an outdated scraper, thank you.

@Injest
Copy link

Injest commented Sep 6, 2022

I'm also getting this AttributeError. Any guidance is appreciated, thanks!

@Injest
Copy link

Injest commented Sep 6, 2022

After creating the cookie.txt file and compiling I get the following error message:

Traceback (most recent call last):
File "C:\Users\Julian\Desktop\chegg\Downloader.py", line 3, in
Downloader.main()
File "C:\Users\xxxx\Desktop\chegg\cheggscraper\Downloader.py", line 40, in main
print(Chegg.url_to_html(args['url'], file_name_format=args['file_format']))
File "C:\Users\xxxxx\Desktop\chegg\cheggscraper\CheggScraper.py", line 521, in url_to_html
headers, heading, question_div, answers__, question_uuid = self._parse(html_text=html_res_text,
File "C:\Users\xxxxx\Desktop\chegg\cheggscraper\CheggScraper.py", line 437, in _parse
re.search(r'C.page.homeworkhelp_question((.*)?);', html_text).group(1))
AttributeError: 'NoneType' object has no attribute 'group'

Please let me know if there is a solution for this or if this is now an outdated scraper, thank you.

I dug a little bit in the debugging section here and noticed the author mention in May that a paid chegg account would be required with the cookie file I'd imagine. There was a patch they released into the new script but Chegg may have updated their code.

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

No branches or pull requests

2 participants