Now, let's check how to go deeper and handle the DOM object and access the properties of a given HTML element.
From the HtmlPage
object, an instance of the HtmlDocument
object can also be obtained. With the HtmlDocument
object, it is possible to:
Search for page elements (by name, class, or type), via the
GetElementById
andGetElementByTagName
methodsAccess the list of the URL parameters
Obtain the cookies
When we search for a page element via the HtmlDocument
object, we obtain an HtmlElement
object. This class provides a series of methods which make it possible to handle the DOM objects. Nevertheless, unless it is strictly necessary, it would be more advisable to modify the HTML objects of the page making use of its own language, JavaScript:
Access/modify the properties of the HTML elements via the
GetProperty
andSetProperty
methodsAccess/modify the attributes of the HTML elements via the
GetAttribute
andSetAttribute
methodsAccess/modify...