Prognocis scrape info from account page v3

save the patient name from billing activity page for later use

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Prognocis scrape info from account page v3
// @namespace    prognocis.com
// @version      2025.01.24.0907
// @description  save the patient name from billing activity page for later use
// @author       mrkrag
// @match        *.prognocis.com/prognocis/scrBillPatientAccount.jsp*
// @icon         https://prognocis.com/wp-content/uploads/2020/07/cropped-Fav-192x192.png
// @grant        none
// @license      MIT
// ==/UserScript==
// first we clear any values saved from prior uses
localStorage.removeItem('patientName');
localStorage.removeItem('patientAcct');
// now set a variable that is assigned to an identifiable element
// in this case we will select the first element with an id of 'top'
var row1 = document.querySelector("#top");
// this sets a variable for the patient name
// using queryselector we will select counting from the known id of 'top' to the first row and then the second cell
var ptname = document.querySelector("#top ~ tr td:nth-child(2)").textContent;
// now we save the textcontent of that cell to localstorage, assigning it a key of 'patientName' with a value of the variable 'ptname'
localStorage.setItem('patientName', ptname);
// do the same to get the next value, in this case the 2nd row and third cell after 'top'
var ptacct = document.querySelector("#top ~ tr:nth-child(2) td:nth-child(3)").textContent.substring(16, 24);
localStorage.setItem('patientAcct', ptacct);