Public
Script
Forked from tmcw/cheerioExample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export let cheerioExample = (async () => {
const { default: $ } = await import("npm:cheerio");
const document = $(
`<select name="ctl00$bodyContentPlaceHolder$ddlistPlayDate" onchange="javascript:setTimeout('__doPostBack(\'ctl00$bodyContentPlaceHolder$ddlistPlayDate\',\'\')', 0)" id="ctl00_bodyContentPlaceHolder_ddlistPlayDate" ondatabinding="document.body.style.cu
<option selected="selected" value="606">6/4/2024 8:00:00 PM</option>
<option selected="selected" value="606">6/5/2024 8:00:00 PM</option>
<option selected="selected" value="606">6/6/2024 8:00:00 PM</option>
</select>`,
);
const elements = document.find("#ctl00_bodyContentPlaceHolder_ddlistPlayDate > option");
console.log(elements.map((_, e) => $(e).text()));
// return document.find("#ctl00_bodyContentPlaceHolder_ddlistPlayDate > option").map(e => e.text());
})();
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
June 2, 2024