Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
zdeneklapes committed Feb 2, 2024
1 parent 776104e commit 4ed2fc4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bazos/scrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,13 @@ def delete_all_advertisements(self):
)

for i in range(self.size_new_products):
wait_random_time(args=self.args, coef=2)
element = self.driver.find_element(By.CLASS_NAME, 'nadpis')
verbose_print(
args=self.args,
message=f"Removing[{i}/{self.size_new_products}]: {element.text}"
)

#
wait_random_time(args=self.args, coef=2)
element.find_element(By.TAG_NAME, 'a').click()
self.delete_advertisement()

Expand Down Expand Up @@ -320,8 +319,6 @@ def create_all_advertisements(self) -> None:
message=f"Adding {self.size_new_products} new advertisements"
)
for idx, product in enumerate(new_products):
wait_random_time(args=self.args, coef=2)

if self.product_already_advertised(product):
verbose_print(
args=self.args,
Expand All @@ -338,6 +335,7 @@ def create_all_advertisements(self) -> None:

# product not advertised ADD them
self.driver.find_element(By.CLASS_NAME, 'pridati').click() # go to add page
wait_random_time(args=self.args, coef=2)
self.driver.find_elements(By.CLASS_NAME, 'iconstblcell')[0].click()
self.create_advertisement(product=product)

Expand Down

0 comments on commit 4ed2fc4

Please sign in to comment.