1
Good night!
I have the following code:
<H3>Dados Cadastrais</H3>
<table class='dados'>
<tr>
<th>Avalista:</th>
<td>VINICIUS ALVES GONZALEZ</td>
<th>Contrato:</th>
<td>72001018 </td>
</tr>
<tr>
How can I reference this element using C# to get the client name inside the <td>
and the contract number tbm ...
I can only handle items that have ID using document.getElementById
In this case, Cod HTML is not mine, it’s a web page where I need to get these values... So in case I can get the "td" with the name I must locate within the "[0]" that varies, the value?
– Vinix Gonzalez
Yes, it will be a great challenge for you to identify that this is the name and not another given, since the tags are without identifiers. Imagine that this page uses more than one table, so yours
document.getElementsByTagName("td")
would return all thetd
of the full page. Dai in this case, the solution would be to get one element inside another already identified. I noticed that the table containing this data has a data class. Soon your code would look something like this.document.getElementsByClass("dados")[0].getElementsByTagName("td")[0];
– Andrew Ribeiro