geirawsm / sausage_bot

Another Discord-bot
1 stars 0 forks source link

Fail på scraping, ingen try/except eller annen magi #13

Closed geirawsm closed 2 years ago

geirawsm commented 2 years ago

Sjekke hva som går an gjøre for å løse denne:

Task exception was never retrieved
future: <Task finished name='Task-13' coro=<Loop._loop() done, defined at /home/geir/.local/share/virtualenvs/bgbot-o5nbRTfr/lib/python3.10/site-packages/discord/ext/tasks/__init__.py:200> exception=AttributeError("'NoneType' object has no attribute 'find_all'")>
Traceback (most recent call last):
  File "/home/geir/.local/share/virtualenvs/bgbot-o5nbRTfr/lib/python3.10/site-packages/discord/ext/tasks/__init__.py", line 264, in _loop
    raise exc
  File "/home/geir/.local/share/virtualenvs/bgbot-o5nbRTfr/lib/python3.10/site-packages/discord/ext/tasks/__init__.py", line 239, in _loop
    await self.coro(*args, **kwargs)
  File "/home/geir/scripts/discord/bgbot/sausage_bot/cogs/scrape_fcb_news.py", line 65, in post_fcb_news
    FEED_POSTS = scrape_fcb_news_links()
  File "/home/geir/scripts/discord/bgbot/sausage_bot/cogs/scrape_fcb_news.py", line 45, in scrape_fcb_news_links
    news_dev = main_dev.find_all('div', attrs={'class': 'feed__items'})
AttributeError: 'NoneType' object has no attribute 'find_all'
geirawsm commented 2 years ago

Denne skal i teorien være ok etter denne: dc9b8366412c45a89eab650accf58817e7641416