Closed AlphaSue closed 1 year ago
Try using the error as prompt (include code) or try using chat gpt manually
The generated code by Chat GPT is not always on point, you have to maybe tweak things here and there.
If you wish to reopen the issue please do following the new issue template.
I asked for a simple web scraping task to get youtuber's subscriptions, get run error and stoped.
Here is my task prompts: help me write python scripts to automatically get data about youtuber subscription number and average view of latest 10 videos, get me rate of views/subscribers, also get each youtubers descriptions and visions, whose website is https://www.youtube.com/@mkbhd/, test with this one: https://www.youtube.com/@mkbhd/videos. I prefer to use webscraping instead of any api.
get error and exits:
Traceback (most recent call last): File "/Users/zhongdasu/Downloads/code/gpt-engineer/projects/my-new-project/workspace/youtubescraper.py", line 62, in
main()
File "/Users/zhongdasu/Downloads/code/gpt-engineer/projects/my-new-project/workspace/youtubescraper.py", line 57, in main
channel_data = scraper.get_channel_data()
File "/Users/zhongdasu/Downloads/code/gpt-engineer/projects/my-new-project/workspace/youtubescraper.py", line 12, in get_channel_data
"subscriber_count": self.get_subscriber_count(),
File "/Users/zhongdasu/Downloads/code/gpt-engineer/projects/my-new-project/workspace/youtubescraper.py", line 22, in get_subscriber_count
subscriber_count = soup.find("span", {"class": "yt-subscription-button-subscriber-count-branded-horizontal"}).text
AttributeError: 'NoneType' object has no attribute 'text'
I know it get nonetype cannot parse the data but how to auto fix it?