Skip to content

Commit 5052a07

Browse files
author
Victor Fernandes
committed
add booking.com
1 parent 31f0d58 commit 5052a07

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

Diff for: e2e/scrappers.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('RowsX - scrappers tests', () => {
5858
await appPage.bringToFront();
5959
await appPage.goto(spec.url, { waitUntil: 'domcontentloaded' });
6060
await extensionPage.goto(extensionUrl, { waitUntil: 'domcontentloaded' });
61-
await appPage.waitForTimeout(200);
61+
await appPage.waitForTimeout(500);
6262
await extensionPage.bringToFront();
6363
const button = await extensionPage.waitForSelector('.copy-btn');
6464
await button.click();
@@ -68,9 +68,9 @@ describe('RowsX - scrappers tests', () => {
6868
await context.overridePermissions(spec.url, ['clipboard-read']);
6969
const clipboard = await appPage.evaluate(() => navigator.clipboard.readText());
7070

71+
expect(clipboard.trimEnd()).toMatchSnapshot();
72+
7173
// close pages
7274
await appPage.close();
73-
74-
expect(clipboard.trimEnd()).toMatchSnapshot();
7575
});
7676
});

Diff for: src/scrappers/booking.yml

+16-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
url: https://www.booking.com/searchresults*
2-
listElementsQuery: .TableRecords > tbody > tr
2+
header: Booking.com search results
3+
listElementsQuery: '[data-testid="property-card"]'
34
elementParser:
4-
- title: Date Movement
5-
query: 'td:nth-child(1) > span'
5+
- title: Title
6+
query: '[data-testid="title"]'
67
type: text
78

8-
- title: Date Movement
9-
query: 'td:nth-child(2) > div > span'
9+
- title: Review score
10+
query: '[data-testid="review-score"] div:nth-child(1)'
1011
type: text
1112

12-
- title: Description
13-
query: 'td:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(2) > a'
13+
- title: Distance
14+
query: '[data-testid="distance"]'
1415
type: text
1516

16-
- title: Value
17-
query: 'td:nth-child(4) > div > span'
17+
- title: Price w/ discounts
18+
query: '[data-testid="price-and-discounted-price"]'
1819
type: text
1920

20-
- title: Balance
21-
query: 'td:nth-child(5) > div > span'
21+
- title: Offers
22+
query: '[data-testid="gallery-ribbon"]'
2223
type: text
24+
25+
- title: Booking URL
26+
query: a
27+
type: clean-url

0 commit comments

Comments
 (0)