This commit is contained in:
R5600U_PC 2024-10-20 23:46:23 +09:00
parent cb31e0e7d1
commit b93ff6783d
12 changed files with 39420 additions and 2 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -9,6 +9,8 @@ product_cost_locator = '//*[@id='productMainContentContainerId']/div/div[2]/div/
standard_selling_price_locator = '//*[@id='productMainContentContainerId']/div/div[2]/div/div/div[5]/div[1]/div/div/div/div/div[2]/table/tbody/tr[{index}]/td[4]/div/div/div[1]/div/div[2]/input'
product_cost_for_single_locator = '//*[@id="productMainContentContainerId"]/div/div[2]/div/div/div[2]/div[1]/div/div/div/div/div[2]/table/tbody/tr[2]/td[2]/div/div/div/div[2]/input'
standard_selling_price_for_single_locator = '//*[@id="productMainContentContainerId"]/div/div[2]/div/div/div[2]/div[1]/div/div/div/div/div[2]/table/tbody/tr[2]/td[3]/div/div/div[1]/div/div[2]/input'
ordering_by_name_locator = 'button:has-text("이름순 정렬")'
ordering_by_option_locator = 'button:has-text("옵션탭 순서 정렬")'
[OptionLocators]
# 옵션 관련 선택자

View File

@ -27,6 +27,8 @@ class LocatorManager:
'standard_selling_price_locator': self.config.get('PriceLocators', 'standard_selling_price_locator').strip("'"),
'product_cost_for_single_locator': self.config.get('PriceLocators', 'product_cost_for_single_locator').strip("'"),
'standard_selling_price_for_single_locator': self.config.get('PriceLocators', 'standard_selling_price_for_single_locator').strip("'"),
'ordering_by_name_locator': self.config.get('PriceLocators', 'ordering_by_name_locator').strip("'"),
'ordering_by_option_locator': self.config.get('PriceLocators', 'ordering_by_option_locator').strip("'"),
}
# BrowserControl 섹션

View File

@ -41,6 +41,8 @@ class PriceHandler:
self.first_delv_fee_input_locator = self.locator_manager.get_locator('PriceLocators', 'first_delv_fee_input_locator')
self.exchange_fee_input_locator = self.locator_manager.get_locator('PriceLocators', 'exchange_fee_input_locator')
self.option_count_text_locator = self.locator_manager.get_locator('PriceLocators', 'option_count_text_locator')
self.ordering_by_name_locator = self.locator_manager.get_locator('PriceLocators', 'ordering_by_name_locator')
self.ordering_by_option_locator = self.locator_manager.get_locator('PriceLocators', 'ordering_by_option_locator')
# self.initialize_values() # 초기값 설정 메서드
self.initial_setting()
@ -89,8 +91,10 @@ class PriceHandler:
sold_price = initial_plusmargin
self.logger.debug(f"더하기마진값{initial_plusmargin}을 팔린가격{sold_price}으로 간주")
self.logger.debug("옵션 가격 정보를 수집합니다.")
self.logger.debug("옵션 가격 정보를 수집하기 위해 옵션가격정렬을 클릭 합니다.")
self.ordering_by_option_button_click()
is_single = self.optionHandler.option_info['is_single_option']
option_data, min_cost, max_cost, avg_cost, upper_avg_cost = await self.collect_product_costs_and_prices(is_single) # 수집된 옵션정보를 반환
@ -792,4 +796,12 @@ class PriceHandler:
self.logger.debug(f"카테고리 {category}는 추가 해외배송비 규칙이 없습니다. 추가 해외배송비는 0으로 설정됩니다.")
self.logger.debug(f"총 추가 해외배송비: {total_extra_shipping}")
return total_extra_shipping
return total_extra_shipping
async def ordering_by_name_button_click(self):
self.logger.debug("가격탭의 이름순 정렬 버튼을 클릭합니다.")
await self.page.click(self.ordering_by_name_locator)
async def ordering_by_option_button_click(self):
self.logger.debug("가격탭의 옵션탭 순서 정렬 버튼을 클릭합니다.")
await self.page.click(self.ordering_by_option_locator)