Apologies in advance if it is a badly worded question, I welcome feedback.
On my page: https://www.dev.roletraining.co.uk/courses-schedule/ I am trying to remove the word "From: "
I've made this script which works on this page: https://www.dev.roletraining.co.uk/upcoming-courses/ but doesn't work on the page in my first link.
window.onload = (event) => {
    var elements = document.querySelectorAll('.wptf_price, .wc-bookings-availability-item-price');
    function walkText(node) {
        if (node.nodeType == 3) {
            node.data = node.data.replace("From: ", "");
        }
        if (node.nodeType == 1 && node.nodeName != "SCRIPT") {
            for (var i = 0; i < node.childNodes.length; i++) {
                walkText(node.childNodes[i]);
            }
        }
    }
    walkText(document.body);
};
I assume it is loading too early. If you put the same code in the console and run it, it works.
Is there a better way to load this JavaScript at a later point?
 
    