Я работаю на внутреннем веб-сайте, на котором есть список данных, перечисленных в следующем порядке:
Date - FirstName - Last Name
01/01/19 - demo - demo
01/01/19 - demo - demo
01/01/19 - demo - eg
01/01/20 - demo - demo
Я пытаюсь выяснить дату изменения (вкладка "Дата").
Я создал один список для даты и два других списка для имени и фамилии и объединил их в последний список.
Как я могу вернуть дату, когда значение начинает меняться, например
01/01/19 - демо - например: результат 01.01.19?
Вот мой сценарий на данный момент:
set creationDate to {}
set firstName to {}
set resultList to {}
set lastName to {}
try
repeat with counter from 1 to 1000
tell application "Safari"
set myValue to do JavaScript "document.getElementsByClassName('auto-date-time')[" & counter & "].innerHTML;" in current tab of window 1
end tell
if myValue = missing value then
exit repeat
else if myValue is not equal to "" then
set the creationDate to the creationDate & myValue
end if
end repeat
on error
--
end try
set listSize to count of creationDate
try
repeat with counter from 1 to 1000
tell application "Safari"
set myValue to do JavaScript "document.getElementsByClassName('sortable firstName')[" & counter & "].innerHTML;" in current tab of window 1
end tell
if myValue = missing value then
exit repeat
else if myValue is not equal to "" then
set the firstName to the firstName & myValue
end if
end repeat
on error
--
end try
set listSize to count of firstName
try
repeat with counter from 1 to 1000
tell application "Safari"
set myValue to do JavaScript "document.getElementsByClassName('sortable lastName')[" & counter & "].innerHTML;" in current tab of window 1
end tell
if myValue = missing value then
exit repeat
else if myValue is not equal to "" then
set the lastName to the lastName & myValue
end if
end repeat
on error
--
end try
set listSize to count of lastName
set resultList to {}
repeat with i from 1 to count creationDate
set end of resultList to {item i of firstName, item i of lastName}
end repeat
repeat with x from 1 to count of items of creationDate
set n to item x of firstName
set m to item x of lastName
set d to item x of creationDate
if n is not equal to m then return d
end repeat