1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| (async function () { const participants = [ ['张三', '2402000****', '13888888888'], ['李四', '2402000****', '13888888888'], ['王五', '2402000****', '13888888888'] ]; try { document.evaluate( '/html/body/div[1]/div[12]/div/div/div[3]/button', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue.click(); const AAA = '/html/body/div/div[1]/div[2]/div[1]/div[2]/div[2]/form/div/div'; document.getElementById('phone').value = '13888888888'; document.evaluate( `${AAA}[3]/div/textarea`, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue.value = '小组讨论'; document.getElementById('room2').click(); await new Promise(resolve => setTimeout(resolve, 100)); const plusButton = document.evaluate( `${AAA}[6]/div/table/thead/tr/th[4]/a/i`, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue; for (let i = 0; i < 3; i++) { plusButton.click(); await new Promise(resolve => setTimeout(resolve, 100)); } participants.forEach((participant, index) => { const [name, idNum, tel] = participant; const nameXPath = `${AAA}[6]/div/table/tbody/tr[${index + 1}]/td[1]/p`; const idXPath = `${AAA}[6]/div/table/tbody/tr[${index + 1}]/td[2]/p`; const telXPath = `${AAA}[6]/div/table/tbody/tr[${index + 1}]/td[3]/p`; const nameNode = document.evaluate(nameXPath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; const idNode = document.evaluate(idXPath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; const telNode = document.evaluate(telXPath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; if (nameNode) nameNode.innerText = name; if (idNode) idNode.innerText = idNum; if (telNode) telNode.innerText = tel; }); } catch (err) { console.error('执行过程中出现错误:', err); } })();
|