Skip to content

Commit 04be4fc

Browse files
Updated DuckDuckGo result link selector for page objects
1 parent eef7086 commit 04be4fc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pages/result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class DuckDuckGoResultPage:
1111

1212
def __init__(self, page: Page) -> None:
1313
self.page = page
14-
self.result_links = page.locator('.result__title a.result__a')
14+
self.result_links = page.locator('a[data-testid="result-title-a"]')
1515
self.search_input = page.locator('#search_form_input')
1616

1717
def result_link_titles(self) -> List[str]:

tutorial/4-page-objects.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Add dependency injection with locators:
210210
```python
211211
def __init__(self, page: Page) -> None:
212212
self.page = page
213-
self.result_links = page.locator('.result__title a.result__a')
213+
self.result_links = page.locator('a[data-testid="result-title-a"]')
214214
self.search_input = page.locator('#search_form_input')
215215
```
216216

@@ -263,7 +263,7 @@ class DuckDuckGoResultPage:
263263

264264
def __init__(self, page: Page) -> None:
265265
self.page = page
266-
self.result_links = page.locator('.result__title a.result__a')
266+
self.result_links = page.locator('a[data-testid="result-title-a"]')
267267
self.search_input = page.locator('#search_form_input')
268268

269269
def result_link_titles(self) -> List[str]:

0 commit comments

Comments
 (0)