Please note that this question is not a duplicate of How to display some part of webpage in android webview? or Android WebView: display only some part of website as they exclude some element whereas i want to include only one.
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
boolean validate=checkIfNet();
if(!validate){
finish();
}
setContentView(R.layout.activity_main);
WebView wb = (WebView) findViewById(R.id.webview);
wb.getSettings().setJavaScriptEnabled(true);
wb.getSettings().setLoadWithOverviewMode(true);
wb.getSettings().setUseWideViewPort(true);
wb.getSettings().setJavaScriptEnabled(true);
wb.getSettings().setBuiltInZoomControls(false);
wb.getSettings().setPluginState(WebSettings.PluginState.ON);
//wb.getSettings().setPluginsEnabled(true);
//wb.setWebViewClient(new HelloWebViewClient());
wb.loadUrl("http://www.dota2.com/leaderboards#europe");
}
private boolean checkIfNet() {
boolean connected = false;
ConnectivityManager connectivityManager = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
if(connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState() == NetworkInfo.State.CONNECTED ||
connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState() == NetworkInfo.State.CONNECTED) {
//we are connected to a network
connected = true;
}
else
connected = false;
return connected;
}
}
Now while getting http://www.dota2.com/leaderboards#europe
it gets the full page. I only want the table in there. The one with tbody id="leaderboard_body"
. I am kind of new so pls chill on me. Thanks in advance.