Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
-1
rated 0 times [  1] [ 2]  / answers: 1 / hits: 32281  / 8 Years ago, wed, july 13, 2016, 12:00:00

How can I get an HTML file from file system and parse specific elements from it.



For example, given the html snippet below, how can I extract the table content and render it?





<html>
<div>
<h1>header</h1>
<table id=a border=1>
<th>Number</th>
<th>content A</th>
<th>contetn A</th>
<th>content A</th>
<tr>
<td>1</td>
<td>a</td>
<td>a</td>
<td>a</td>
</tr>
<th>Number</th>
<th>content B</th>
<th>content B</th>
<th>content B</th>

<tr>
<td>1</td>
<td>b</td>
<td>b</td>
<td>b</td>
</tr>
</table>
</div>
<br>
<footer>footer</footer>

</html>




More From » html

 Answers
7

Just download HTML with fetch(), parse it using fast-html-parser, write result to state and render that state with WebView


[#61398] Monday, July 11, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
arturo

Total Points: 331
Total Questions: 99
Total Answers: 92

Location: Austria
Member since Thu, Jan 7, 2021
3 Years ago
arturo questions
;