Android爬虫
作者:
gsn_hear | 来源:发表于
2020-05-23 11:44 被阅读0次
添加依赖:
compile 'org.jsoup:jsoup:1.13.1'
目标参数:
![](https://img.haomeiwen.com/i7786170/a76325e55ce96543.png)
image.png
调用方法
new Thread() {
public void run() {
Document doc = null;
try {
doc = Jsoup.connect("https://www.aliyun.com/?spm=5176.13203013.fnqwg5agi.2.7c9231f9XNJzKY").get();
} catch (IOException e) {
e.printStackTrace();
}
Elements newsHeadlines = doc.select("a.top-list-item.pointer");
for (Element headline : newsHeadlines) {
Log.d("data", "名称:" + headline.text() + "网址:" + headline.absUrl("href"));
}
}
}.start();
本文标题:Android爬虫
本文链接:https://www.haomeiwen.com/subject/amccahtx.html
网友评论