Skip to content

Commit

Permalink
Fix crawl canvas element
Browse files Browse the repository at this point in the history
  • Loading branch information
Spenhouet committed Oct 26, 2024
1 parent c77ee9e commit ed58e86
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions entities/circle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ export default class Adapter implements bcked.entity.Adapter {
});

const dateText = $("p:contains('As of')").next().text().trim();
const cashText = ($("#usdc_chartjs_canvas")[0] as cheerio.TagElement).attribs[
"data-usdc-cash"
];
const canvasElement = $("#usdc_chartjs_canvas")[0] as HTMLCanvasElement | undefined;
const cashText = canvasElement?.getAttribute("data-usdc-cash");

if (!dateText || !cashText) return;

Expand Down

0 comments on commit ed58e86

Please sign in to comment.