Skip to content

Commit 7cd11f9

Browse files
added log folder for debbuging
1 parent 69d0eaa commit 7cd11f9

9 files changed

Lines changed: 48 additions & 0 deletions

File tree

logs/Daraz_scraping.log

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
'2026-03-24 11:54:21 | INFO | undetected_chromedriver.patcher | patching driver executable C:\Users\Ibrahim Sheikh\appdata\roaming\undetected_chromedriver\undetected_chromedriver.exe
2+
'2026-03-24 11:54:26 | INFO | Daraz screper informations | ******Daraz product info scraper has been run********
3+
'2026-03-24 11:54:32 | INFO | Daraz screper informations | ******sucessfully lounch the browser********
4+
'2026-03-24 11:54:39 | INFO | Daraz screper informations | ******entered the product name and scarching the product********

product_info.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
1: product name: Airpods Pro / tws wireless earbuds Bluetooth bluetooth headphone With High Base replica and long Battery
2+
product price: ৳ 299
3+
product rating: Ratings 9992: product name: Leno~vo Livepods Airpods_Pro True Wireless Bluetooth Tws Headset Earbuds Earphones - Bluetooth Headphone
4+
product price: ৳ 380
5+
product rating: Ratings 183: product name: Style Re TWS Bluetooth Earbuds - Wireless Earphones with ENC, Bass Boost, pro Battery, Type-C Charging - Charging Case - 3 Hours Playtime - Premium Sound Quality
6+
product price: ৳ 263
7+
product rating: Ratings 10944: product name: Mocho M10 TWS Earbuds 2500mAh Charging Box Bluetooth-compatible Stereo Waterproof
8+
product price: ৳ 339
9+
product rating: Ratings 54845: product name: Airpods Pro / tws Black edition wireless earbuds Bluetooth replica Bluetooth headphone
10+
product price: ৳ 299
11+
product rating: Ratings 766: product name: AirPods Pro 2nd Generation Made in DUbai long lasting specials replica edition wireless blutooth Earbuds
12+
product price: ৳ 309
13+
product rating: Ratings 817: product name: AirPods Pro 2nd Generation long lasting specials edition wireless Blutooth replica Earbuds By Next Gadget
14+
product price: ৳ 309
15+
product rating: Ratings 3578: product name: M10 TWS Earbuds 2500mAh Charging Box Bluetooth-compatible Stereo Waterproof
16+
product price: ৳ 316
17+
product rating: Ratings 69: product name: AirPods Pro 2nd genaration Made in Dubai Wireless Charging Bluetooth Earbuds
18+
product price: ৳ 457
19+
product rating: Ratings 911
Binary file not shown.
654 Bytes
Binary file not shown.

test_action_page/test_main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
from base_pages.daraz_product_info_scrape import Daraz_product_info_scraper
22
from utilities.read_propertice import read_config
3+
from utilities.custom_loger import log_maker
34

45

56

67
class Test_Daraz_product_scraper():
8+
logger = log_maker.log_gen()
79
def test_scrape_product(self,setup):
10+
self.logger.info("******Daraz product info scraper has been run********")
811
self.driver = setup
912
self.driver.get(read_config.get_url())
13+
self.logger.info("******sucessfully lounch the browser********")
1014
product_page = Daraz_product_info_scraper(self.driver)
1115
product_page.enter_product_name(read_config.get_product_name())
1216
product_page.click_scarch_btn()
17+
self.logger.info("******entered the product name and scarching the product********")
1318
product_page.get_product_info(int(read_config.get_total_page()))
19+
self.logger.info("******all the page has been scraped sucessfully********")
20+
1421

1522

1623

test_data/product_info.xlsx

-456 Bytes
Binary file not shown.

test_data/~$product_info.xlsx

-165 Bytes
Binary file not shown.
1.41 KB
Binary file not shown.

utilities/custom_loger.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import logging
2+
import datetime
3+
import os
4+
5+
folder_name = "logs"
6+
if not os.path.exists(folder_name):
7+
os.makedirs(folder_name)
8+
9+
log_path = os.path.join(folder_name,"Daraz_scraping.log")
10+
11+
12+
class log_maker():
13+
@staticmethod
14+
def log_gen():
15+
logging.basicConfig(filename= log_path,level=logging.INFO,format="'%(asctime)s | %(levelname)s | %(name)s | %(message)s",datefmt="%Y-%m-%d %H:%M:%S",force=True)
16+
logger = logging.getLogger("Daraz screper informations")
17+
logger.setLevel(logging.INFO)
18+
return logger

0 commit comments

Comments
 (0)