0
Next, how can I capture pure html from a page, for example "site.com.br/tabela_precos"
this site has a return basically like this:
<html> ....
arquivos e configurações javascript ....
outras tags html .....
......
and here a table
<h2 id="tabela_titulo">Título</h2>
<table id="tabela_info">
<tr>
<td>Dado da tabela</td>
</tr>
the <tr> e <td>
are without id/class, the idea would be to loop them, as they follow a pattern will have no problems...
and after picking up these values, I would like to send them via Ajax to a PHP file
Do you have access to this PHP? If so, why not get the table data directly with PHP?
– Woss
I thought it would be faster/easier with javascript since it can access the DOM.
– Thiago
It can easily access your page’s DOM. From an external page, PHP does it in a similar way and you save a request. Just get the HTML code from this page and analyze it with the class
DOMDocument
.– Woss
I didn’t know that, thank you very much, I’ll take a look
– Thiago