Purpose
Retrieve all label/value pairs in the expanded Additional Fund Facts section of an NB ETF product page and report whether an expense ratio field is present.
When to Use
Use for any NB ETF when the product name or product URL is available and the caller needs structured fund-fact fields, especially expense ratio.
Workflow
- Start a fresh browser session when prior sessions may have state bleed.
- If the canonical product URL and
nbmifund identifier are known, navigate directly tohttps://www.nb.com/products/etfs/{product-slug}?nbmi={fund-id}. Do not guess{fund-id}. If only the ETF name is known, first use NB's ETF listing/search to locate the matching product page and read its canonical URL andnbmiparameter. - On the loaded product page, run this single evaluator to expand Additional Fund Facts and extract the pairs:
(async () => {
const button = [...document.querySelectorAll("button")].find((b) =>
/View Additional Fund Facts/i.test(b.textContent || ""),
);
if (button) {
button.click();
await new Promise((resolve) => setTimeout(resolve, 800));
}
const pairs = [...document.querySelectorAll("h4")]
.map((h4) => {
const value = h4.nextElementSibling;
return value && value.tagName === "P"
? [h4.textContent.trim(), value.textContent.trim()]
: null;
})
.filter(Boolean);
const expense = pairs.find(([label]) => /expense ratio/i.test(label));
return {
url: location.href,
pairs,
hasExpenseRatio: !!expense,
expenseRatio: expense ? expense[1] : null,
};
})();Site-Specific Gotchas
- The product URL uses an opaque
nbmiquery parameter; resolve it from NB's product/listing page rather than inventing an identifier. - Additional facts are hidden behind a button labeled
View Additional Fund Facts; allow the content to render after clicking before extracting. - The current structure places labels in
h4elements and values in an immediately followingp. Non-fact headings or headings without a following paragraph are excluded. - Use a fresh browser/provider session if another finance site has contaminated session state.
Expected Output
Return the evaluator object: the final URL, an ordered pairs array of [label, value], hasExpenseRatio, and the matching expenseRatio value or null.