Skip to content

Commit

Permalink
remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
modhurita committed Jan 29, 2024
1 parent e451698 commit 8c0af09
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions artscraper/find_artworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ def get_artist_works(self):
# Find elements with tag name 'h3'
items_elements = parent_element.find_elements('tag name', 'h3')
for element in items_elements:
if 'items' in element.text:
match = re.search(r'\d+', element.text)
if 'items' in element.text:
match = re.search(r'\d+', element.text)
if match:
total_num_artworks = int(match.group())
break

# Initialize number of artworks
num_artworks = 0

Expand All @@ -234,7 +234,7 @@ def get_artist_works(self):
'.//*[contains(@data-gaaction,"rightArrow")]')
# Click on right arrow button
self.driver.execute_script("arguments[0].click();", right_arrow_element)

# List of all elements with links to artworks
elements = right_arrow_element.find_elements('xpath', \
'//*[contains(@href,"/asset/")]')
Expand All @@ -243,7 +243,7 @@ def get_artist_works(self):
list_links = [element.get_attribute('href') for element in elements]

num_artworks = len(list_links)

# Check if total number of artworks is reached
if num_artworks < total_num_artworks:
# Wait for page to load
Expand Down

0 comments on commit 8c0af09

Please sign in to comment.