use group 0 of targetUrl instead of group 1 #588
parent
9b77306098
commit
211ac74389
|
@ -74,7 +74,7 @@ class ModelPageProcessor implements PageProcessor {
|
||||||
for (Pattern targetUrlPattern : urlPatterns) {
|
for (Pattern targetUrlPattern : urlPatterns) {
|
||||||
Matcher matcher = targetUrlPattern.matcher(link);
|
Matcher matcher = targetUrlPattern.matcher(link);
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
page.addTargetRequest(new Request(matcher.group(1)));
|
page.addTargetRequest(new Request(matcher.group(0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,12 +163,12 @@ class PageModelExtractor {
|
||||||
private void initClassExtractors() {
|
private void initClassExtractors() {
|
||||||
Annotation annotation = clazz.getAnnotation(TargetUrl.class);
|
Annotation annotation = clazz.getAnnotation(TargetUrl.class);
|
||||||
if (annotation == null) {
|
if (annotation == null) {
|
||||||
targetUrlPatterns.add(Pattern.compile("(.*)"));
|
targetUrlPatterns.add(Pattern.compile(".*"));
|
||||||
} else {
|
} else {
|
||||||
TargetUrl targetUrl = (TargetUrl) annotation;
|
TargetUrl targetUrl = (TargetUrl) annotation;
|
||||||
String[] value = targetUrl.value();
|
String[] value = targetUrl.value();
|
||||||
for (String s : value) {
|
for (String s : value) {
|
||||||
targetUrlPatterns.add(Pattern.compile("(" + s.replace(".", "\\.").replace("*", "[^\"'#]*") + ")"));
|
targetUrlPatterns.add(Pattern.compile(s.replace(".", "\\.").replace("*", "[^\"'#]*")));
|
||||||
}
|
}
|
||||||
if (!targetUrl.sourceRegion().equals("")) {
|
if (!targetUrl.sourceRegion().equals("")) {
|
||||||
targetUrlRegionSelector = new XpathSelector(targetUrl.sourceRegion());
|
targetUrlRegionSelector = new XpathSelector(targetUrl.sourceRegion());
|
||||||
|
@ -179,7 +179,7 @@ class PageModelExtractor {
|
||||||
HelpUrl helpUrl = (HelpUrl) annotation;
|
HelpUrl helpUrl = (HelpUrl) annotation;
|
||||||
String[] value = helpUrl.value();
|
String[] value = helpUrl.value();
|
||||||
for (String s : value) {
|
for (String s : value) {
|
||||||
helpUrlPatterns.add(Pattern.compile("(" + s.replace(".", "\\.").replace("*", "[^\"'#]*") + ")"));
|
helpUrlPatterns.add(Pattern.compile(s.replace(".", "\\.").replace("*", "[^\"'#]*")));
|
||||||
}
|
}
|
||||||
if (!helpUrl.sourceRegion().equals("")) {
|
if (!helpUrl.sourceRegion().equals("")) {
|
||||||
helpUrlRegionSelector = new XpathSelector(helpUrl.sourceRegion());
|
helpUrlRegionSelector = new XpathSelector(helpUrl.sourceRegion());
|
||||||
|
|
Loading…
Reference in New Issue