File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export const getDriverLineup = async (): Promise<isDriver[]> => {
39
39
$ ( "a.group" ) . each ( function ( ) {
40
40
const firstName : string = $ ( this ) . find ( "div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > p:nth-child(1)" ) . text ( ) . trim ( ) ;
41
41
const secondName : string = $ ( this ) . find ( "div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > p:nth-child(2)" ) . text ( ) . trim ( ) ;
42
- const team : string = $ ( this ) . find ( "div:nth-child(1) > div:nth-child(1) > p:nth-child(3)" ) . text ( ) ;
42
+ const team : string = $ ( this ) . find ( "div:nth-child(1) > div:nth-child(1) > p:nth-child(3)" ) . text ( ) . trim ( ) ;
43
43
const nationalityImage : string | undefined = $ ( this ) . find ( "div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > img:nth-child(2)" ) . attr ( "src" ) ;
44
44
const driverImage : string | undefined = $ ( this ) . find ( "div:nth-child(1) > div:nth-child(1) > div:nth-child(4) > img:nth-child(2)" ) . attr ( "src" ) ;
45
45
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ export const getDriverStandings = async (year: number = new Date().getFullYear()
13
13
const $ = cheerio . load ( response . data ) ;
14
14
15
15
$ ( ".f1-table > tbody:nth-child(2) > tr" ) . each ( function ( ) {
16
- const position : number = parseInt ( $ ( this ) . find ( "td:nth-child(1) > p:nth-child(1)" ) . text ( ) ) ;
17
- const driver_1 : string = $ ( this ) . find ( "td:nth-child(2) > p:nth-child(1) > a:nth-child(1) > span:nth-child(1)" ) . text ( ) ;
18
- const driver_2 : string = $ ( this ) . find ( "td:nth-child(2) > p:nth-child(1) > a:nth-child(1) > span:nth-child(2)" ) . text ( ) ;
19
- const driver : string = driver_1 . concat ( " " , driver_2 ) ;
16
+ const position : number = parseInt ( $ ( this ) . find ( "td:nth-child(1) > p:nth-child(1)" ) . text ( ) . trim ( ) ) ;
17
+ const driver_1 : string = $ ( this ) . find ( "td:nth-child(2) > p:nth-child(1) > a:nth-child(1) > span:nth-child(1)" ) . text ( ) . trim ( ) ;
18
+ const driver_2 : string = $ ( this ) . find ( "td:nth-child(2) > p:nth-child(1) > a:nth-child(1) > span:nth-child(2)" ) . text ( ) . trim ( ) ;
19
+ const driver : string = driver_1 . concat ( " " , driver_2 . slice ( 0 , driver_2 . length - 3 ) ) ;
20
20
const nationality : string = $ ( this ) . find ( " td:nth-child(3) > p:nth-child(1)" ) . text ( ) ;
21
21
const team : string = $ ( this ) . find ( "td:nth-child(4) > p:nth-child(1) > a:nth-child(1)" ) . text ( ) ;
22
22
const points : number = parseInt ( $ ( this ) . find ( " td:nth-child(5) > p:nth-child(1) " ) . text ( ) ) ;
Original file line number Diff line number Diff line change 1
1
export { getFastestLaps } from "./scraper/fastest-laps" ;
2
2
export { getDriverLineup } from "./scraper/driver-lineup" ;
3
3
export { getTeamLineup } from "./scraper/team-lineup" ;
4
- // export { getDriverStandings } from "./scraper/driver-standings";
4
+ export { getDriverStandings } from "./scraper/driver-standings" ;
5
5
// export { getConstructorStandings } from "./scraper/constructors-standings";
6
6
// export { getWorldChampions } from "./scraper/world-champions";
7
7
// export { getRaceResults } from "./scraper/race-results";
You can’t perform that action at this time.
0 commit comments