Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package step1;
- import java.io.File;
- import java.io.IOException;
- import org.jsoup.Jsoup;
- import org.jsoup.nodes.Document;
- public class Task {
- /**
- * @param filePath 文件路径:backups/www.ctrip.com.txt/
- * @return
- * @throws IOException
- */
- public Document getHtml1(String filePath) throws IOException{
- /********** Begin **********/
- Document document = Jsoup.parse( new File( "./backups/www.ctrip.com.txt" ) , "utf-8" );
- return document;
- /********** End **********/
- }
- /**
- *
- * @param filePath 文件路径:backups/hotels.ctrip.com_domestic-city-hotel.txt/
- * @return
- * @throws IOException
- */
- public Document getHtml2(String filePath) throws IOException{
- /********** Begin **********/
- Document document = Jsoup.parse( new File( "./backups/hotels.ctrip.com_domestic-city-hotel.txt" ) , "utf-8" );
- return document;
- /********** End **********/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement