파이썬 소스
부가세 신고 연습 페이지(https://yynb.tistory.com/32)에
data_buga.xlsx 에 있는 데이터를 자동으로 입력하는 소스입니다.
잘 응용하면 부가세 신고 때 홈택스에서 3천건이상 입력하는 걸 자동으로
할 수 있기를 희망하면서 연습해봅니다.
import time
import pandas as pd
from selenium import webdriver
from seleniuhttp://m.webdriver.common.keys import Keys
from seleniuhttp://m.webdriver.common.by import By
from seleniuhttp://m.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# Load the Excel data using pandas
excel_file = r'C:\Users\Young\Documents\Jupyter\data_buga.xlsx' # Replace with your actual Excel file path
df = pd.read_excel(excel_file)
# Start the Selenium WebDriver (Make sure you have downloaded ChromeDriver or another browser's driver)
driver = webdriver.Chrome() # Or provide the path to your WebDriver like webdriver.Chrome('path_to_chromedriver')
# Open the web page
driver.get('https://yynb.tistory.com/32')
# Give the page time to load
time.sleep(3)
# Iterate over each row in the Excel data
for index, row in df.iterrows():
# Input for Card Member Number (example locator by name)
card_member_input = driver.find_element(By.NAME, 'cardNumber')
card_member_input.clear()
card_member_input.send_keys(str(int(row['Card'])))
# Input for Business Registration Number (example locator by name)
business_reg_input = driver.find_element(By.NAME, 'businessNumber')
business_reg_input.clear()
business_reg_input.send_keys(str(int(row['Bsno'])))
# Input for Number of Transactions (example locator by name)
transaction_count_input = driver.find_element(By.NAME, 'transactionCount')
transaction_count_input.clear()
transaction_count_input.send_keys(str(int(row['Count'])))
# Input for Supply Price (example locator by name)
supply_price_input = driver.find_element(By.NAME, 'supplyPrice')
supply_price_input.clear()
supply_price_input.send_keys(str(int(row['Price'])))
# Wait until the button is clickable before interacting with it
add_button = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="merchantForm"]/button')))
add_button.click()
# Wait a moment before processing the next row
time.sleep(2)
# Close the browser when done
#driver.quit()
'컴퓨터 놀이' 카테고리의 다른 글
부가세 신고 자동 입력 Project (1) | 2024.09.28 |
---|---|
사업자번호 조회 소스 (0) | 2024.09.28 |
[파이썬]사업자등록번호 조회 (1) | 2024.09.27 |
부분합과 횟수 만들기 (IF함수 + SUMIF함수, COUNTIF함수) (0) | 2024.09.27 |
부가세 신고 연습 소스 (1) | 2024.09.27 |