Skip to content

Commit

Permalink
fix: css selector for date
Browse files Browse the repository at this point in the history
  • Loading branch information
Mg30 committed Jan 18, 2025
1 parent db60d11 commit b28b172
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/scrapers.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function extractOddsData(page, callback, leagueName) {
try {

await page.goto(`https://www.oddsportal.com${link}`);
const [day, date, time] = await page.$$eval('div.bg-event-start-time ~ p', els => els.map(el => el.innerText));
const [day, date, time] = await page.$$eval(`[data-testid="game-time-item"] p`, els => els.map(el => el.innerText));
const [homeTeam, awayTeam] = await page.$$eval(
`[data-testid="game-participants"] p.truncate`,
(els) => els.map((el) => el.textContent)
Expand Down
1 change: 1 addition & 0 deletions tests/scrapers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe('Scrapers Integration Tests', () => {
expect(fileContent.scrapedAt).toBeDefined();
expect(fileContent.homeTeam).toBeDefined();
expect(fileContent.awayTeam).toBeDefined();
expect(fileContent.date).toBeDefined();

expect(fileContent.mlFullTime).toBeInstanceOf(Array);
expect(fileContent.mlFullTime.length).toBeGreaterThan(0);
Expand Down

0 comments on commit b28b172

Please sign in to comment.