Results 1 to 9 of 9
Thread: problem with the pageFetcher
- 06-01-2010, 08:50 PM #1
Member
- Join Date
- May 2010
- Posts
- 8
- Rep Power
- 0
problem with the pageFetcher
Hello, I use this code
for(int i = 0; i < citylink.length; i++) {
body=pF.fetchpage(citylink[i][1]);
// It's for taking the url from the table citylink
// and returns the source of this url!
i have also declared it in my pagefetcher.java class like this:
public String fetchPage(String url) {
try {
url = URIUtil.encodeQuery(url);
} catch (URIException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
but when I compile it it says that the method fetchpage(String) is undefined for the type PageFetcher and I can't run my problem! I don't know what to do.
then i corrected and in pagefetcher.java and i put citylink everywhere exists the url but it still doesn't compile.....
- 06-01-2010, 11:03 PM #2
Please post the full text of the error message.
Also will need to see the code the defines the class and the references to the class.
- 06-01-2010, 11:06 PM #3
Member
- Join Date
- May 2010
- Posts
- 8
- Rep Power
- 0
the errors are two
at Weather.main(Weather.java:226)
at PageFetcher.fetchPage(PageFetcher.java:108)
- 06-01-2010, 11:07 PM #4
Member
- Join Date
- May 2010
- Posts
- 8
- Rep Power
- 0
what code to u exactly want?the weather.java or the pagefetcher.java?
- 06-01-2010, 11:11 PM #5
You've only shown one line. Need all of it.Please post the full text of the error message.
- 06-01-2010, 11:24 PM #6
Member
- Join Date
- May 2010
- Posts
- 8
- Rep Power
- 0
this is what it says to me when i compile it
at PageFetcher.fetchPage(PageFetcher.java:108)
get = new GetMethod(citylink); it refers here in my pagefetcher.java
at Weather.main(Weather.java:226)
body=pF.fetchPage(citylink[i][1]);
it also gets me an error that says
Description Resource Path Location Type
This method must return a result of type String Weather.java weather8/src line 35 Java Problem
private static String getSnippetFrom(String body, String prefix,//it's right here
String suffix) {
final int kSnippetLength = 2500;
try {
Matcher m = Pattern.compile(prefix).matcher(body);
String snippet;
if (m.find())
{
snippet = body.substring(m.end(0), body.length());
if (suffix != null && snippet.indexOf(suffix) > 0) {
snippet = snippet.substring(0, snippet.indexOf(suffix));
}
if (snippet.length() > kSnippetLength) {
snippet = snippet.substring(0, kSnippetLength);
snippet = HtmlMethods.stripOutTags(snippet);
return snippet;
}
}
else
return "";
}
- 06-01-2010, 11:47 PM #7
When posting formatted text please put it in Quote tags to preserver the indentation.
What you have posted is very hard to read.
I expect to see something like this:
Just noticed that you've spelled your classes using different case: upper and lower. Java is case sensitive. Be sure all spellings are identicalestArrayDef.java:11: cannot find symbol
symbol : variable object
location: class TestArrayDef
object.method(10);
^Last edited by Norm; 06-01-2010 at 11:56 PM.
- 06-01-2010, 11:59 PM #8
Member
- Join Date
- May 2010
- Posts
- 8
- Rep Power
- 0
i use eclipse how i can see it in this way??because it doesn't appear t me like this
- 06-02-2010, 12:02 AM #9


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks