1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
|
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
public class crawler {
private static final int ms_timeout = 5000;
public static void main(String[] args) throws MalformedURLException, IOException
{
Document doc = Jsoup.parse(new URL("eineinternetseite.de"), ms_timeout);
String htmlString = doc.toString();
Pattern pattern = Pattern.compile("\\d+");
Matcher matcher = pattern.matcher(htmlString);
while(matcher.find())
{
System.out.println(matcher.group());
}
}
} |