-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Expand file tree
/
Copy pathpage.py
More file actions
20 lines (15 loc) · 753 Bytes
/
page.py
File metadata and controls
20 lines (15 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from selenium.webdriver.remote.webdriver import WebDriver
from bandcamp.web.base import WebPage
from bandcamp.web.element import DiscoverTrackList
from bandcamp.web.locators import DiscoverPageLocator
class DiscoverPage(WebPage, DiscoverPageLocator):
"""Model the relevant parts of the Bandcamp Discover page."""
def __init__(self, driver: WebDriver) -> None:
super().__init__(driver)
self._accept_cookie_consent()
self.discover_tracklist = DiscoverTrackList(
self._driver.find_element(*self.DISCOVER_RESULTS), self._driver
)
def _accept_cookie_consent(self) -> None:
"""Accept the necessary cookie consent."""
self._driver.find_element(*self.COOKIE_ACCEPT_NECESSARY).click()