I am working on a project with jsoup. The point is that I am not able to connect to the target URL. I get this error:
W/System.err: java.net.MalformedURLException: unknown protocol: location
I don't know exactly what unknown protocol: location
means.
This is my code. The code works perfectly with other websites, but there is one website where it doesn't work.
public class connect extends AsyncTask<Void, Void, Void> {
String string;
@Override
protected Void doInBackground(Void... voids) {
try {
Document document = Jsoup.connect(url).get();
Elements elements = document.select("div.tray_name");
string = elements.html();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
textView.setText(string);
}
}