Implementation ideas:
1. Use the java.net.URL object to bind the address of a certain web page on the network.
2. Obtain an HttpConnection object through the openConnection() method of the java.net.URL object
3. Obtain the input stream object of the network file through the getInputStream() method of the HttpConnection object.
4. Looping the data in the stream, and the regular expression area compiled by the Pattern object is matched with each line of characters to obtain the email address
package cn.sdhzzl;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;//Operations related to network import java.net.URL;import java.net.URLConnection;import java.util.regex.Matcher;import java.util.regex.Pattern;public class Test {public static void main(String[] args) throws IOException {//1.1 Create a url object URL url = new URL("https://www.VeVB.COM/group/topic/8845032/"); //1.2 Open the connection URLConnection conn = url.openConnection(); //1.3 Set the timeout unit for connection network to milliseconds conn.setConnectTimeout(1000 * 10); //1.4 Read the file in the specified network address through stream operations BufferedReader bufr = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line = null; //1.5 Regular String regex that matches email = "[a-zA-Z0-9_-]+@//w+//.[az]+(//.[az]+)?";//1.6 Use the compile() method of the pattern to generate the pattern object Pattern p = Pattern.compile(regex); //1. while((line = bufr.readLine()) != null) { Matcher m = p.matcher(line); while(m.find()) { System.out.println(m.group());// Get the matching email } } }}The above java code to crawl web email is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.