Skip to content

Commit

Permalink
fix css selector for homeTeam/AwayTeam in extractOddsData
Browse files Browse the repository at this point in the history
  • Loading branch information
OB42 authored and Mg30 committed Jan 18, 2025
1 parent 1cbe6d8 commit a54ead2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/scrapers.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ async function extractOddsData(page, callback, leagueName) {

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 [homeTeam, awayTeam] = await page.$$eval('span.truncate', els => els.map(el => el.textContent));
const [homeTeam, awayTeam] = await page.$$eval(
`[data-testid="game-participants"] p.truncate`,
(els) => els.map((el) => el.textContent)
);
const mlFullTime = await extractMlOdds(page, "fullTime");
const mlFirstHalf = await extractMlOdds(page, "firstHalf");
const mlSecondHalf = await extractMlOdds(page, "secondHalf");
Expand Down Expand Up @@ -274,4 +277,4 @@ async function nextMatchesScraper(browser, leagueName, oddsFormat, callback) {
}


export { historicScraper, nextMatchesScraper };
export { historicScraper, nextMatchesScraper };

0 comments on commit a54ead2

Please sign in to comment.