Prognocis scrape info from account page v3

save the patient name from billing activity page for later use

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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);