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

Failed to fetch solution? #3

Open
pinelop opened this issue Feb 20, 2021 · 5 comments
Open

Failed to fetch solution? #3

pinelop opened this issue Feb 20, 2021 · 5 comments

Comments

@pinelop
Copy link

pinelop commented Feb 20, 2021

I get for almost all problems:

Failed to execute <bound method LeetCodeCrawler.fetch_solution of <crawler.LeetCodeCrawler object at 0x105034550>>, Reason: 'NoneType' object is not subscriptable

Any ideas?

@Peng-YM
Copy link
Owner

Peng-YM commented Feb 21, 2021

Could you describe how the error occurs in detail? It is very difficult for me to figure out why from the error log

@pinelop
Copy link
Author

pinelop commented Feb 21, 2021

The issue seems to be the following, otherwise its a 404 for /problem/

     def fetch_problem(self, slug, accepted=False):
-        print(f"🤖 Fetching problem: https://leetcode.com/problem/{slug}/...")
+        print(f"🤖 Fetching problem: https://leetcode.com/problems/{slug}/...")

@pinelop pinelop closed this as completed Feb 21, 2021
@pinelop pinelop reopened this Feb 21, 2021
@pinelop
Copy link
Author

pinelop commented Feb 21, 2021

The issue seems to be the following, otherwise its a 404 for /problem/

     def fetch_problem(self, slug, accepted=False):
-        print(f"🤖 Fetching problem: https://leetcode.com/problem/{slug}/...")
+        print(f"🤖 Fetching problem: https://leetcode.com/problems/{slug}/...")

For me it works now with this change, I also changed question_id to frontend_question_id so I can pass my self problems to be included as what the user seems to be actually frontend_question_id.

Is it working for you at API /problem/ ?

@jchan172
Copy link

For the original question,

Failed to execute <bound method LeetCodeCrawler.fetch_solution of <crawler.LeetCodeCrawler object at 0x105034550>>, Reason: 'NoneType' object is not subscriptable

This happens when there isn't a solution for the problem on LeetCode. Not all problems have an available solution. It would be good to catch the error and print it or at least indicate this in the readme.

@Peng-YM
Copy link
Owner

Peng-YM commented May 29, 2021

These days I am pretty busy, could you consider opening a PR to fix this issue? Thank you very much for your information.

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

3 participants