chegg-scraper icon indicating copy to clipboard operation
chegg-scraper copied to clipboard

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

Open bayramj opened this issue 2 years ago • 2 comments

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.

bayramj avatar Aug 21 '22 22:08 bayramj

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

Injest avatar Sep 06 '22 17:09 Injest

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.

Injest avatar Sep 06 '22 17:09 Injest