From e380fda885367c31df2c6f613f42dbe1e5f01772 Mon Sep 17 00:00:00 2001 From: FujiwaraChoki Date: Sat, 17 Feb 2024 18:20:02 +0100 Subject: [PATCH] Refactor scrape_product_information method in AFM.py --- src/classes/AFM.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/classes/AFM.py b/src/classes/AFM.py index c232869..044934f 100644 --- a/src/classes/AFM.py +++ b/src/classes/AFM.py @@ -65,26 +65,26 @@ class AffiliateMarketing: def scrape_product_information(self) -> None: """ - This method will be used to scrape the product information from the affiliate link. + This method will be used to scrape the product + information from the affiliate link. """ # Open the affiliate link self.browser.get(self.affiliate_link) - # Get the product name product_title: str = self.browser.find_element(By.ID, AMAZON_PRODUCT_TITLE_ID).text - - if get_verbose(): - info(f"Product Title: {product_title}") - - # Set the product title - self.product_title: str = product_title - + # Get the features of the product features: any = self.browser.find_elements(By.ID, AMAZON_FEATURE_BULLETS_ID) + if get_verbose(): + info(f"Product Title: {product_title}") + if get_verbose(): info(f"Features: {features}") + + # Set the product title + self.product_title: str = product_title # Set the features self.features: any = features