`
command = f"""
var targetDate = {target_date}
var jcd = "01";
var callback = arguments[0];
var target_time = {target_time}
url = '/rsv.selectTimeScd.dp/dmparse.dm';
data = {{"fRsvD":targetDate, "fJiyukCd":"01"}};
$('div.rsvTable tbody#rsvTableBody').html("");
postAjax(url, data, function(result){{
var timesList = result.times;
var rowcnt_this = 1;
for(var i=0; i<timesList.length; i++) {{
var rowcnt = timesList[i].rowcnt;
var label = timesList[i].rsLabel.replace(":", "시 ") + "분";
var btClass = '';
console.log(timesList[i].fRsvT.slice(0,2))
if (timesList[i].fRsvT.slice(0,2) == target_time)
...
if(rowcnt_this == rowcnt)
rowcnt_this = 1;
else
rowcnt_this++;
}}
return callback;
}})
"""
`
I am trying to execute_script in webdriver of selenium. And I need to pass data to multiple lines of string. However, there was multiple brace in the string, thus I replaced “{” into “{{“” However, it doesn’t work at all. How can I change the code in order to execute correctly?