Skip to content

Commit 827b689

Browse files
committed
Fix get world champions method
1 parent 1044aa9 commit 827b689

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/scraper/world-champions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export const getWorldChampions = async (): Promise<isHallOfFame[]> => {
1212
const response = await axios(staticLinks.hallOfFame);
1313
const $ = cheerio.load(response.data);
1414

15-
$("div.grid:nth-child(2) > a").each(function () {
16-
const name: string = $(this).find("figure:nth-child(1) > figcaption:nth-child(2) > p:nth-child(1)").text().trim();
17-
const driver_image: string | undefined = $(this).find("figure:nth-child(1) > picture:nth-child(1) > img:nth-child(1)").attr("src");
15+
$("div.grid:nth-child(2) > span").each(function () {
16+
const name: string = $(this).find("span:nth-child(2) > a > span").text().trim();
17+
const driver_image: string | undefined = $(this).find("span:nth-child(1) > span > img").attr("src");
1818

1919
if (name.length !== 0 && driver_image?.length !== 0) {
2020
const worldChampion: isHallOfFame = {

src/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export { getFastestLaps } from "./scraper/fastest-laps";
22
export { getDriverLineup } from "./scraper/driver-lineup";
33
export { getTeamLineup } from "./scraper/team-lineup";
44
export { getDriverStandings } from "./scraper/driver-standings";
5-
// export { getConstructorStandings } from "./scraper/constructors-standings";
6-
// export { getWorldChampions } from "./scraper/world-champions";
5+
export { getConstructorStandings } from "./scraper/constructors-standings";
6+
export { getWorldChampions } from "./scraper/world-champions";
77
// export { getRaceResults } from "./scraper/race-results";
88
// export { getRaceSchedule } from "./scraper/race-schedule";

0 commit comments

Comments
 (0)