Excelシートからデータをインポートし、そのパラメータをPythonスクリプトに渡そうとしています。このスクリプトでは、「ブラウザ」をExcelファイルのパラメータとしても使用しようとしています。以下はその詳細です。ドライバの代わりにwebdriverにパラメータを渡す
ブラウザはExcelシートの "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)
あなたのExcelのB2値には、より近い "()"がない可能性があります。 –