fix bug
This commit is contained in:
1 parent
715e052c02
commit
72039ef643
2 files changed
+12
-173
No files matched your search
+12
-2
@@ -7,8 +7,18 @@ import java.util.regex.Matcher;
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
String regex = "<em class=\"\">(\\d+)</em>.*?<span class=\"title\">(.*?)</span>.*?导演: (.*?) 主演: (.*?)<br>.*?(\\d{4}) / .*?<span class=\"rating_num\" property=\"v:average\">(.*?)</span>";
|
||||
String htmlContent = HtmlFetcher.fetchHtmlContent("https://movie.douban.com/top250");
|
||||
Matcher m = MatcherGetter.getMatcher(regex, htmlContent);
|
||||
StringBuilder htmlContent = new StringBuilder();
|
||||
htmlContent.append(HtmlFetcher.fetchHtmlContent("https://movie.douban.com/top250"));
|
||||
htmlContent.append(HtmlFetcher.fetchHtmlContent("https://movie.douban.com/top250?start=25"));
|
||||
htmlContent.append(HtmlFetcher.fetchHtmlContent("https://movie.douban.com/top250?start=50"));
|
||||
htmlContent.append(HtmlFetcher.fetchHtmlContent("https://movie.douban.com/top250?start=75"));
|
||||
htmlContent.append(HtmlFetcher.fetchHtmlContent("https://movie.douban.com/top250?start=100"));
|
||||
htmlContent.append(HtmlFetcher.fetchHtmlContent("https://movie.douban.com/top250?start=125"));
|
||||
htmlContent.append(HtmlFetcher.fetchHtmlContent("https://movie.douban.com/top250?start=150"));
|
||||
htmlContent.append(HtmlFetcher.fetchHtmlContent("https://movie.douban.com/top250?start=175"));
|
||||
htmlContent.append(HtmlFetcher.fetchHtmlContent("https://movie.douban.com/top250?start=200"));
|
||||
htmlContent.append(HtmlFetcher.fetchHtmlContent("https://movie.douban.com/top250?start=225"));
|
||||
Matcher m = MatcherGetter.getMatcher(regex, htmlContent.toString());
|
||||
StringBuilder movieInfo = new StringBuilder();
|
||||
movieInfo.append("豆瓣电影 Top 250\n\n");
|
||||
while (m.find()) {
|
||||
|
||||
Reference in new issue
Block a user