android - extracting data -


i want extract data website data structure

<td  class="text-anouncments"><span class="nav-white"><marquee onmouseover=this.stop() onmouseout=this.start() behavior="scroll"  width="100%"  direction="left" scrollamount="3" scrolldelay="3"  ><strong>                     <a href="index.php?name=news&file=article&topic=3&sid=1510" class="nav-white">title</a></strong> , &nbsp;&nbsp;&nbsp;&nbsp;<strong>                     <a href="index.php?name=news&file=article&topic=3&sid=1508" class="nav-white">title </a></strong> , &nbsp;&nbsp;&nbsp;&nbsp;<strong>                     <a href="index.php?name=news&file=article&topic=3&sid=1502" class="nav-white">title</a></strong> , &nbsp;&nbsp;&nbsp;&nbsp;<strong>                     <a href="index.php?name=news&file=article&topic=3&sid=1501" class="nav-white">title</a></strong> , &nbsp;&nbsp;&nbsp;&nbsp;<strong>                     <a href="index.php?name=news&file=article&topic=3&sid=1497" class="nav-white">title</a></strong> , &nbsp;&nbsp;&nbsp;&nbsp;</marquee></span></td> 

my question can linked title between <a></a> tag put them in list build android web-application

with sample code below can text between <a> tags , @ example title

if want actual link of each 1 stored @ link variable, @ example index.php?name=news&file=article&topic=3&sid=1510 etc.

$('.nav-white').each(function() {   var txt = $(this).text(); //the text between <a> tags   var link = $(this).attr('href'); //the link each 1 points   //print them console see works   console.log(txt);   console.log(link ); }); 

you can make txt , link variables arrays can use them in function if wish.

var texts = new array(); var links = new array();  $('.nav-white').each(function() {   texts.push( $(this).text() ); //the text between <a> tags   links.push( $(this).attr('href') ); //the link each 1 points }); 

also have typed wrong strong attribute. <strong>some text</strong> . in code posted have reversed.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -