My anki addon isn't finding the notes

# import the main window object (mw) from aqt
from aqt import mw
# import the "show info" tool from
from aqt.utils import showInfo, qconnect
# import all of the Qt GUI library
from aqt.qt import *
from bs4 import BeautifulSoup
import requests

def return_search(word):
    html = f"{word}"
    webpage = requests.get(html).content
    soup = BeautifulSoup(webpage, "html.parser")
    meanings_list = []
    meanings = soup.find_all(attrs = {"class": "meaning-meaning"})

    for count, item in enumerate(meanings):
        meanings_list.append(f"{count+1}) {item.get_text()}")

    meanings_list = '\n\n'.join(meanings_list)

    return meanings_list

def testFunction() -> None:
    ids = mw.col.find_cards("tag:jpzr")
    for _id in ids:
        note = mw.col.getNote(_id)
        meaning_list = return_search(note["Focus"])
        note["Meaning"] += meaning_list

# create a new menu item, "test"
action = QAction("test", mw)
# set it to call testFunction when it's clicked
qconnect(action.triggered, testFunction)
# and add it to the tools menu

I’m getting an error in line 27 of my addon code when trying to find the note - does anyone know how to fix this?

It would help to know what the error is, but you’re clearly passing a card id to getNote(). Use find_notes() to get note ids. As an aside, camelcase names, at least in pylib, are deprecated, so you should also replace getNote() with get_note().


This worked, thank you so much