z

PuppeteerSharp - example

etc 2021. 7. 8. 16:02

element: xpath로 얻어온 puppeteerSharp JSHandle object

element.EvaluateFunctionAsync('node=>node.innerText')
element.EvaluateFunctionAsync('node=>node.attributes["id"].textContent')
element.EvaluateFunctionAsync('()=>{document.querySelector("#obj_id").innerText="modified value";}')
element.EvaluateFunctionAsync('()=>{document.querySelector("#obj_id").click();}')

element.GetPropertyAsync('textContent').Result
element.GetPropertyAsync('attributes').Result.GetPropertyAsync('id').Result.GetPropertyAsync('textContent').Result

AND