Android 如何从站点获取名称和图像源?
如何从android studio中的站点获取名称和图像源 从本网站: 结果我提取了链接,但这些链接指向图标图像、标题图像等。 我得到的是网站的原始数据。 我需要的是检查网站的数据Android 如何从站点获取名称和图像源?,android,Android,如何从android studio中的站点获取名称和图像源 从本网站: 结果我提取了链接,但这些链接指向图标图像、标题图像等。 我得到的是网站的原始数据。 我需要的是检查网站的数据 protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); DownloadClass link
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
DownloadClass link = new DownloadClass();
String get = null;
try {
get = link.execute("https://www.forbesindia.com/lists/2019-celebrity-100/1819/all").get();
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
Pattern p = Pattern.compile("src=\"(.*?)\"");
Matcher m = p.matcher(get);
while(m.find()){
System.out.println(m.group(1));
}
Log.i("return:",get);
}