Have you come across a website where the URL of a specific button changes weekly? Are you looking for a solution to create a bookmark that will redirect you to this changing URL?
You may have tried using a Bookmarklet, but encountered issues as the JavaScript code needs the page to load completely when executed.
Below is an example of what you may have attempted:
javascript:(function(){
window.location.href = "https://rasp.tpu.ru/site/department.html?id=7950&cource=1";
window.location.href = Array.from(document.querySelectorAll('a')).find(element => element.href.includes('gruppa_42148')).href
})();
If waiting for the website to load didn't solve the problem, such as in the script below:
javascript:(function(){
window.location.href = "https://rasp.tpu.ru/site/department.html?id=7950&cource=1";
window.addEventListener('load', function () { window.location.href = Array.from(document.querySelectorAll('a')).find(element => element.href.includes('gruppa_42148')).href })
})();
You may be facing limitations with bookmarklets in accessing content from one page to another for continuation of the script.
Alternatively, consider exploring options like writing a script in Tampermonkey that triggers only when visiting the site from a specific bookmark. However, the implementation may require further research and experimentation.