Through jsoup I'm able to retrieve the Registration Date data but unable to get second column value 31/12/2009. Instead it returns empty string. I tried all possible ways.
All the table rows are extracting correctly.
<tr>
<td style="width: 30%; font-weight: bold; background-color: #d7e8ff; ">
<span style="font-size: 10pt"> Registration Date</span></td>
<td style="margin-bottom: 1px; padding-bottom: 1px; background
color:lemonchiffon;">
<span id="ContentPlaceHolder1_636042629082042500">الخميس 31/12/2009</span>
<span id="ContentPlaceHolder1_iInstalldate"></span></td>
</tr>
Here is the java code I'm using:
Element table = doc.select("TABLE").get(2);
Elements table1=table.select("table[border=1]"); // to select particular
//table
Elements rows=table1.select("tr");
for (int i = 0; i < rows.size(); i++) {
Element row = rows.get(i);
Elements cols=row.select("td");
for (Element col : cols) {
if (!(col.text().equals("")))
Log.e("test", col.text()+cols.size());
}
}
Here is the output but only values in first column not the second one:
Registration Date , Account Type , Current Account Status , Total Account Credit , Used Credit , Valid Credit , Credit Expiry Date
Now Here is the Sample Source of this page table with following Rows
<tr>
<td style="width: 30%; font-weight: bold; background-color: #d7e8ff; ">
<span style="font-size: 10pt">Registration Date</span></td>
<td style="margin-bottom: 1px; padding-bottom: 1px; background-color:
lemonchiffon;">
<span id="ContentPlaceHolder1_636045303384071212">الخميس 31/12/2009</span>
<span id="ContentPlaceHolder1_iInstalldate"></span></td>
</tr>
<tr>
<td style="width: 30%; font-weight: bold; background-color: #d7e8ff;
">Account Type</td>
<td style="margin-bottom: 1px; padding-bottom: 1px; background-color:
lemonchiffon;">
<span id="ContentPlaceHolder1_636045303384071212">1 Mbps---فضي</span>
<span id="ContentPlaceHolder1_iAcctType"></span></td>
</tr>
Here is the code i am using to access the web page
loginForm=Jsoup.connect("http://adsl.yemen.net.ye/en/user_main.aspx")
.data("ctl00$ContentPlaceHolder1$loginframe$Password", "MAMAM")
.data("ctl00$ContentPlaceHolder1$loginframe$LoginButton", "Sign In")
.data("__LASTFOCUS", "")
.data("__EVENTTARGET", "")
.data("__EVENTARGUMENT","")
.userAgent("Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/51.0.2704.103 Safari/537.36")
.cookies(loginForm.cookies())
.followRedirects(false)
.method(Connection.Method.POST)
.execute();