Post

Replies

Boosts

Views

Activity

Reply to JavaScript to externally automate Webpage operation
Thank you DarkPaw, for responding so promptly. And for the reprimand, justly deserved. Oops, was not aware the (3) black ticks were so important. The error (line 11, and in the alternative code in line 13) occurs at the first attempt to find the "Fuel Mix" button. Error: "First parameter passed to Document constructor must be an object" function run(input, parameters) { var Safari = Application('Safari'); Safari.activate(); // Open the AEMO data dashboard (Opens the web page correctly) Safari.Document().make(); Safari.windows[0].currentTab.url = 'https://www.aemo.com.au/energy-systems/electricity/national-electricity-market-nem/data-nem/data-dashboard-nem'; // Open the AEMO data dashboard (Fails to open the Web page consistently) // Safari.openLocation('https://www.aemo.com.au/energy-systems/electricity/national-electricity-market-nem/data-nem/data-dashboard-nem'); delay(10); // Wait for page to load // Click the Fuel Mix tab (target the active <li> in the tabs) (Creates an Error: First parameter passed to Document constructor must be an object) // Safari.Document(0).doJavaScript("document.querySelector('.tabs .active').click()"); // An Alternative: Click the Fuel Mix tab (fourth tab in the list, creates the Error) document.querySelectorAll('.tabs-heading li').length; const tabs = document.querySelectorAll('.tabs-heading li'); if (tabs.length > 3) { tabs[3].click(); } else console.error('Not enough tab elements found.'); } delay(5); // Wait for tab content to load // Select 48 hrs from the dropdown Safari.Document(0).doJavaScript("document.querySelector('#interval').value = '48H'; document.querySelector('#interval').dispatchEvent(new Event('change'))"); delay(5); // Wait for selection to take effect // Click the download button Safari.Document(0).doJavaScript("document.querySelector('.visualisation-icon-button').click()"); return input; } Thanks again for your patience. Robert.
Topic: Safari & Web SubTopic: General Tags:
Jun ’25
Reply to Xcode C++ #include "/UTF-8-Encoder.hpp"
Got it, it was lurking in the SimpleXls Suite, outside the two main folders. Thank you for the time you all (39) took to read and ponder the issue.. .
Replies
Boosts
Views
Activity
Nov ’22
Reply to JavaScript to externally automate Webpage operation
Thank you DarkPaw, for responding so promptly. And for the reprimand, justly deserved. Oops, was not aware the (3) black ticks were so important. The error (line 11, and in the alternative code in line 13) occurs at the first attempt to find the "Fuel Mix" button. Error: "First parameter passed to Document constructor must be an object" function run(input, parameters) { var Safari = Application('Safari'); Safari.activate(); // Open the AEMO data dashboard (Opens the web page correctly) Safari.Document().make(); Safari.windows[0].currentTab.url = 'https://www.aemo.com.au/energy-systems/electricity/national-electricity-market-nem/data-nem/data-dashboard-nem'; // Open the AEMO data dashboard (Fails to open the Web page consistently) // Safari.openLocation('https://www.aemo.com.au/energy-systems/electricity/national-electricity-market-nem/data-nem/data-dashboard-nem'); delay(10); // Wait for page to load // Click the Fuel Mix tab (target the active <li> in the tabs) (Creates an Error: First parameter passed to Document constructor must be an object) // Safari.Document(0).doJavaScript("document.querySelector('.tabs .active').click()"); // An Alternative: Click the Fuel Mix tab (fourth tab in the list, creates the Error) document.querySelectorAll('.tabs-heading li').length; const tabs = document.querySelectorAll('.tabs-heading li'); if (tabs.length > 3) { tabs[3].click(); } else console.error('Not enough tab elements found.'); } delay(5); // Wait for tab content to load // Select 48 hrs from the dropdown Safari.Document(0).doJavaScript("document.querySelector('#interval').value = '48H'; document.querySelector('#interval').dispatchEvent(new Event('change'))"); delay(5); // Wait for selection to take effect // Click the download button Safari.Document(0).doJavaScript("document.querySelector('.visualisation-icon-button').click()"); return input; } Thanks again for your patience. Robert.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’25
Reply to Apple Script to Automate Web Page Plot Data
Thank you DTS Engineer, Over the next few days, I will dig deeper into your guideline. I discovered that I can copy and paste the JavaScript into Safari Console while the page is open to test the download button code. Thank you, I will let our know how I get on... Robert.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’25