Excel 시트에서 데이터를 가져 와서 해당 매개 변수를 Python 스크립트에 전달하려고합니다. 여기서 "브라우저"도 Excel 파일의 매개 변수로 사용하려고합니다. 다음은 세부 사항입니다.대신 드라이버 webdriver에 매개 변수를 전달합니다.
브라우저는 엑셀 시트의 "B2"셀에 지정됩니다
이통합 문서 이름 : Data.xlsx
는 시트 이름 : 구성
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.expected_conditions import alert_is_present
import openpyxl
wb=openpyxl.load_workbook('Data.xlsx')
config=wb.get_sheet_by_name('Configuration')
'''b1=config["B2"].value'''
url=config["B3"].value
uid=config['B4'].value
pwd=config['B5'].value
Browser=webdriver.config['B2'].value()
'''in the above deceleration I am trying to pass the value from excel sheet, instead of writing the value directly. So from next time on wards, I can update in excel sheet with the required browser'''
class Actions():
def OpenApplication():
Browser.get(url)
엑셀 B2 값에 더 가까운 "()"이 없을 수 있습니다. –