Day 099 - Project 99 : Scrape the Community Hub

If you have any questions, comments, or issues with this project please post them here!

Iā€™m unlucky :smiling_face_with_tear:

waiting game it is.

You can try scraping something else. I am currently trying to scrape the /Learn section for new courses :wink:

1 Like

hello, i need i help with the end of it
:melting_face:

Hi @BamlakTefera, welcome to the community!

What do you need help with?

3 Likes
Traceback (most recent call last):
  File "main.py", line 3, in <module>
    import schedule, time, os, smtplib 
ModuleNotFoundError: No module named 'schedule'

why is it possible I get this message when I do:

import schedule

If it worked wonders in day 98?

1 Like

Try poetry add schedule in the Shell? :woman_shrugging:

2 Likes

I set the name of a db with db["/ai-on-replit"]
There is no way I can erase it, even with db.clear()
And itā€™s giving me trouble to read now dbs.
Its all because of the ā€œ/ā€. Any idea?

yeah yeah I refreshed the page several times and it loaded the poetry eventually.
Itā€™s a bug on you guys!

If youā€™re okay with erasing the whole db, you can try running this in the Shell tab:

replit nuke --i-am-sure
1 Like

This issue happened before but I canā€™t find the topic

I got the same error message in the shell when I type your command.
Im starting a new Replā€¦ copying pasting the code.
Thanks anyway

What error does it return?

Traceback (most recent call last):
   File "/home/runner/Day99100Days/venv/bin/replit", line 8, in <module>
     sys.exit(cli())
   File "/home/runner/Day99100Days/venv/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
     return self.main(*args, **kwargs)
   File "/home/runner/Day99100Days/venv/lib/python3.8/site-packages/click/core.py", line 1055, in main
     rv = self.invoke(ctx)
   File "/home/runner/Day99100Days/venv/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
     return _process_result(sub_ctx.command.invoke(sub_ctx))
   File "/home/runner/Day99100Days/venv/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
     return ctx.invoke(self.callback, **ctx.params)
   File "/home/runner/Day99100Days/venv/lib/python3.8/site-packages/click/core.py", line 760, in invoke
     return __callback(*args, **kwargs)
   File "/home/runner/Day99100Days/venv/lib/python3.8/site-packages/replit/__main__.py", line 79, in nuke_db
     del database[k]
   File "/home/runner/Day99100Days/venv/lib/python3.8/site-packages/replit/database/database.py", line 540, in __delitem__
     raise KeyError(key)
 KeyError: '/ai-on-replit'

Found the topic, apparently no fix was found for it. @python-padawan youā€™re going to have to make a new Repl

1 Like

Hmm. Iā€™ll take a look in a bit by making a bad key myself and seeing what I can do.

2 Likes
from replit import db

def delete_all_keys():
    try:
        keys = db.keys()
        for key in keys:
            del db[key]
        return True
    except Exception as e:
        print(f"An error occurred: {e}")
        return False

success = delete_all_keys()

if success:
   print("All keys deleted successfully.")
else:
   print("Failed to delete keys.")

You will probably need to clear the entire database.

but thatā€™ll just print Failed to delete keys.

2 Likes

Yeah I just realized that, ignore that code I sent. :skull:

2 Likes

After some quick fiddling, I canā€™t manage to find a way to delete the key, so instead I PRā€™d Replitā€™s package to prevent something like this from happening again:

2 Likes