htmlparser-user Mailing List for HTML Parser (Page 11)
Brought to you by:
derrickoswald
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(7) |
Feb
|
Mar
(9) |
Apr
(50) |
May
(20) |
Jun
(47) |
Jul
(37) |
Aug
(32) |
Sep
(30) |
Oct
(11) |
Nov
(37) |
Dec
(47) |
2003 |
Jan
(31) |
Feb
(70) |
Mar
(67) |
Apr
(34) |
May
(66) |
Jun
(25) |
Jul
(48) |
Aug
(43) |
Sep
(58) |
Oct
(25) |
Nov
(10) |
Dec
(25) |
2004 |
Jan
(38) |
Feb
(17) |
Mar
(24) |
Apr
(25) |
May
(11) |
Jun
(6) |
Jul
(24) |
Aug
(42) |
Sep
(13) |
Oct
(17) |
Nov
(13) |
Dec
(44) |
2005 |
Jan
(10) |
Feb
(16) |
Mar
(16) |
Apr
(23) |
May
(6) |
Jun
(19) |
Jul
(39) |
Aug
(15) |
Sep
(40) |
Oct
(49) |
Nov
(29) |
Dec
(41) |
2006 |
Jan
(28) |
Feb
(24) |
Mar
(52) |
Apr
(41) |
May
(31) |
Jun
(34) |
Jul
(22) |
Aug
(12) |
Sep
(11) |
Oct
(11) |
Nov
(11) |
Dec
(4) |
2007 |
Jan
(39) |
Feb
(13) |
Mar
(16) |
Apr
(24) |
May
(13) |
Jun
(12) |
Jul
(21) |
Aug
(61) |
Sep
(31) |
Oct
(13) |
Nov
(32) |
Dec
(15) |
2008 |
Jan
(7) |
Feb
(8) |
Mar
(14) |
Apr
(12) |
May
(23) |
Jun
(20) |
Jul
(9) |
Aug
(6) |
Sep
(2) |
Oct
(7) |
Nov
(3) |
Dec
(2) |
2009 |
Jan
(5) |
Feb
(8) |
Mar
(10) |
Apr
(22) |
May
(85) |
Jun
(82) |
Jul
(45) |
Aug
(28) |
Sep
(26) |
Oct
(50) |
Nov
(8) |
Dec
(16) |
2010 |
Jan
(3) |
Feb
(11) |
Mar
(39) |
Apr
(56) |
May
(80) |
Jun
(64) |
Jul
(49) |
Aug
(48) |
Sep
(16) |
Oct
(3) |
Nov
(5) |
Dec
(5) |
2011 |
Jan
(13) |
Feb
|
Mar
(1) |
Apr
(7) |
May
(7) |
Jun
(7) |
Jul
(7) |
Aug
(8) |
Sep
|
Oct
(6) |
Nov
(2) |
Dec
|
2012 |
Jan
(5) |
Feb
|
Mar
(3) |
Apr
(3) |
May
(4) |
Jun
(8) |
Jul
(1) |
Aug
(5) |
Sep
(10) |
Oct
(3) |
Nov
(2) |
Dec
(4) |
2013 |
Jan
(4) |
Feb
(2) |
Mar
(7) |
Apr
(7) |
May
(6) |
Jun
(7) |
Jul
(3) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(4) |
2015 |
Jan
(4) |
Feb
(2) |
Mar
(8) |
Apr
(7) |
May
(6) |
Jun
(7) |
Jul
(3) |
Aug
(1) |
Sep
(1) |
Oct
(4) |
Nov
(3) |
Dec
(4) |
2016 |
Jan
(4) |
Feb
(6) |
Mar
(9) |
Apr
(9) |
May
(6) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
2017 |
Jan
|
Feb
(1) |
Mar
(3) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(2) |
Aug
(3) |
Sep
(6) |
Oct
(3) |
Nov
(2) |
Dec
(5) |
2018 |
Jan
(3) |
Feb
(13) |
Mar
(28) |
Apr
(5) |
May
(4) |
Jun
(2) |
Jul
(2) |
Aug
(8) |
Sep
(2) |
Oct
(1) |
Nov
(5) |
Dec
(1) |
2019 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
2020 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(1) |
2021 |
Jan
(3) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Chris B. <cba...@mi...> - 2011-06-30 09:39:56
|
Hi there, I use Aperture to extract text which runs Htmlparser when processing HTML. My question relates to the handling of presentation tags such as <u>, <b>, <i> when embedded within words - for example: <html><body><u>north</u>ern</body></html> What I would expect is that I should be delivered the word "northern" - but instead I get two tokens: "north" and "ern", which is clearly wrong in this context. It seems that Htmlparser is replacing tags with whitespace - why is this? Thanks for any help. - Chris |
From: Derrick O. <der...@gm...> - 2011-06-20 05:36:13
|
No, I'm afraid there isn't. The only real documentation is the javadocs<http://htmlparser.sourceforge.net/javadoc/index.html> . There are quite a few examples of standalone programs provided in the source code. Search for public static void main (String[] args) For example, in org.htmlparser.Parser (located in htmlparser\trunk\parser\src\main\java\org\htmlparser\Parser.java): /** * The main program, which can be executed from the command line. * @param args A URL or file name to parse, and an optional tag name to be * used as a filter. */ public static void main (String [] args) { Parser parser; NodeFilter filter; if (args.length < 1 || args[0].equals ("-help")) { System.out.println ("HTML Parser v" + getVersion () + "\n"); System.out.println (); System.out.println ("Syntax : java -jar htmlparser.jar" + " <file/page> [type]"); System.out.println (" <file/page> the URL or file to be parsed"); System.out.println (" type the node type, for example:"); System.out.println (" A - Show only the link tags"); System.out.println (" IMG - Show only the image tags"); System.out.println (" TITLE - Show only the title tag"); System.out.println (); System.out.println ("Example : java -jar htmlparser.jar" + " http://www.yahoo.com"); System.out.println (); } else try { parser = new Parser (); if (1 < args.length) filter = new TagNameFilter (args[1]); else { filter = null; // for a simple dump, use more verbose settings parser.setFeedback (Parser.STDOUT); getConnectionManager ().setMonitor (parser); } getConnectionManager ().setRedirectionProcessingEnabled (true); getConnectionManager ().setCookieProcessingEnabled (true); parser.setResource (args[0]); System.out.println (parser.parse (filter)); } catch (ParserException e) { e.printStackTrace (); } } and in org.htmlparser.beans.StringBean (htmlparser\trunk\parser\src\main\java\org\htmlparser\beans\StringBean.java): /** * Unit test. * @param args Pass arg[0] as the URL to process. */ public static void main (String[] args) { if (0 >= args.length) System.out.println ("Usage: java -classpath htmlparser.jar" + " org.htmlparser.beans.StringBean <http://whatever_url>"); else { StringBean sb = new StringBean (); sb.setLinks (false); sb.setReplaceNonBreakingSpaces (true); sb.setCollapse (true); sb.setURL (args[0]); System.out.println (sb.getStrings ()); } } On Mon, Jun 20, 2011 at 7:23 AM, Michael Ghasemi <mi...@co...> wrote: > ** > Hello > I am new to java, is there a tutorial/guide on how to use all features of > htmlparser? > > Thanks > > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > |
From: Michael G. <mi...@co...> - 2011-06-20 05:23:19
|
Hello I am new to java, is there a tutorial/guide on how to use all features of htmlparser? Thanks |
From: 丛林 <con...@gm...> - 2011-05-07 00:55:46
|
Dear Oswald, As you say, if we use OrFilter, the filtered result is mixed with many node types. I think the subsequent processing is more complex and more fallible, such as regex, matching and so on Is there any Function as, nodelist[] {NA, NB} = FUNCTION(Filter[] {FA, FB}) or is there any easy subsequent processing? Best Wishes, -Lin 2011/5/7 Derrick Oswald <der...@gm...>: > Depending on what you want to do with the nodes, you should be able to get > both in one pass with an OR filter: > NodeFilter x = new OrFilter (A, B); > This will give one list with both node types and you'll have to handle that > in the subsequent processing. > > On Sun, May 1, 2011 at 4:56 AM, 丛林 <con...@gm...> wrote: >> >> Hi, I am a freshman in htmlparser area. >> >> My problem is: >> If I want to filter many tags, how can I complete it during one parser >> with out reset this parser? >> >> For example: >> NodeFilter A = new TagNameFilter("A"); >> NodeList a = new NodeList(); >> >> NodeFilter B = new TagNameFilter("B"); >> NodeList b = new NodeList(); >> >> Now, I have to fetch a and b with parser during two times: >> >> a = Parser.parser(A); >> Parser.reset(); >> b = Parser.parser(B); >> >> Can I complete these once? >> [a, b] = Parser.parser(A, B); >> As you know, another Parser will consume more resourse. >> >> >> Thanks for your help :-) >> >> Best Wishes, >> >> -LIn >> >> >> ------------------------------------------------------------------------------ >> WhatsUp Gold - Download Free Network Management Software >> The most intuitive, comprehensive, and cost-effective network >> management toolset available today. Delivers lowest initial >> acquisition cost and overall TCO of any competing solution. >> http://p.sf.net/sfu/whatsupgold-sd >> _______________________________________________ >> Htmlparser-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > |
From: Derrick O. <der...@gm...> - 2011-05-06 19:26:34
|
Depending on what you want to do with the nodes, you should be able to get both in one pass with an OR filter: NodeFilter x = new OrFilter (A, B); This will give one list with both node types and you'll have to handle that in the subsequent processing. On Sun, May 1, 2011 at 4:56 AM, 丛林 <con...@gm...> wrote: > Hi, I am a freshman in htmlparser area. > > My problem is: > If I want to filter many tags, how can I complete it during one parser > with out reset this parser? > > For example: > NodeFilter A = new TagNameFilter("A"); > NodeList a = new NodeList(); > > NodeFilter B = new TagNameFilter("B"); > NodeList b = new NodeList(); > > Now, I have to fetch a and b with parser during two times: > > a = Parser.parser(A); > Parser.reset(); > b = Parser.parser(B); > > Can I complete these once? > [a, b] = Parser.parser(A, B); > As you know, another Parser will consume more resourse. > > > Thanks for your help :-) > > Best Wishes, > > -LIn > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > |
From: 丛林 <con...@gm...> - 2011-05-01 12:06:08
|
Hi all, I implement a new constructor to meet this need, with the modifications in org.htmlparser.Parse org.htmlparser.lexer.Lexer org.htmlparser.lexer.Page Finally, in the org.htmlparser.lexer.Page.setConnection, I create "stream" as: stream = new Stream(ByteArrayInputStream (bytes[] )), instead of, stream = new Stream(getConnection().getInputStream). While at the same time, I set mConnection as null in this method setConnection(). With primary test, it works. Now my question is: Whether these modifications make some other hiddened errors, especially the null mConnection? BTW: I think this kind of constructor is useful, just like these are ByteArrayInputStream and FileInputStream in java.io.InputStream. Best Wishes, -Lin 2011/5/1 丛林 <con...@gm...>: > Hi, I am a freshman in htmlparser area. > > My problem is: > How can I construct a "Parser" instant from the original bytes? > I have to construct a new "Parser" in this way because the original > bytes is already read from a file to the memory. > > > For example: > File f = new File("/home/test.html"); > bytes[] b = bufferstreamreadfrom(f); > Parser p = new Parser(p); // how can i construct ? > > > > Thanks for any suggestion :-) > > Best Wishes, > > -LIn > |
From: 丛林 <con...@gm...> - 2011-05-01 02:56:36
|
Hi, I am a freshman in htmlparser area. My problem is: If I want to filter many tags, how can I complete it during one parser with out reset this parser? For example: NodeFilter A = new TagNameFilter("A"); NodeList a = new NodeList(); NodeFilter B = new TagNameFilter("B"); NodeList b = new NodeList(); Now, I have to fetch a and b with parser during two times: a = Parser.parser(A); Parser.reset(); b = Parser.parser(B); Can I complete these once? [a, b] = Parser.parser(A, B); As you know, another Parser will consume more resourse. Thanks for your help :-) Best Wishes, -LIn |
From: 丛林 <con...@gm...> - 2011-05-01 02:31:23
|
Hi, I am a freshman in htmlparser area. My problem is: How can I construct a "Parser" instant from the original bytes? I have to construct a new "Parser" in this way because the original bytes is already read from a file to the memory. For example: File f = new File("/home/test.html"); bytes[] b = bufferstreamreadfrom(f); Parser p = new Parser(p); // how can i construct ? Thanks for any suggestion :-) Best Wishes, -LIn |
From: semeera B <sem...@ya...> - 2011-04-27 18:47:30
|
http://collinapecas.com.br/index002-291.html |
From: semeera B <sem...@ya...> - 2011-04-24 18:49:53
|
http://ppcult.com.br/index-rhto18.php |
From: Andreas K. <lin...@gm...> - 2011-04-06 07:22:01
|
Congratulations! Happy birthday og thank you for a nice tool for parsing HTML. Regards Andreas Den 03-04-2011 17:26, Derrick Oswald skrev: > Today, the HTML Parser project marks its 10th year of existence. > It has been downloaded over 395,612 times over its history. > We hope it continues to provide the benefits that developers have > enjoyed since it started - an easy to use, fast, flexible HTML parser. > Thanks to all those who have contributed to the project - and to all > those who have used it. > > > > ------------------------------------------------------------------------------ > Create and publish websites with WebMatrix > Use the most popular FREE web apps or write code yourself; > WebMatrix provides all the features you need to develop and > publish your website. http://p.sf.net/sfu/ms-webmatrix-sf > > > > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user |
From: Somik R. <som...@gm...> - 2011-04-04 01:00:21
|
Happy Birthday! Thank you for leading this project, Derrick! Regards, Somik On Sun, Apr 3, 2011 at 5:46 PM, Xue-Feng Yang <jus...@ya...> wrote: > Happy Birthday! > > ------------------------------ > *From:* Derrick Oswald <der...@gm...> > *To:* htmlparser user list <htm...@li...> > *Sent:* Sun, April 3, 2011 11:26:21 AM > *Subject:* [Htmlparser-user] Happy Birthday! > > Today, the HTML Parser project marks its 10th year of existence. > It has been downloaded over 395,612 times over its history. > We hope it continues to provide the benefits that developers have enjoyed > since it started - an easy to use, fast, flexible HTML parser. > Thanks to all those who have contributed to the project - and to all those > who have used it. > > > ------------------------------------------------------------------------------ > Create and publish websites with WebMatrix > Use the most popular FREE web apps or write code yourself; > WebMatrix provides all the features you need to develop and > publish your website. http://p.sf.net/sfu/ms-webmatrix-sf > > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > -- Somik Raha Ph. D., Decision and Risk Analysis Dept. of Management Science & Engg. Stanford University (650) 450-8246 so...@st... http://www.stanford.edu/~somik/ ************************************************ "We judge others by their behavior. We judge ourselves by our intentions." - Ian Percy "The small truth has words that are clear; the great truth has great silence." "I slept and dreamt that life was joy. I awoke and saw that life was service. I acted and behold, service was joy." -- Rabindranath Tagore ************************************************ |
From: Xue-Feng Y. <jus...@ya...> - 2011-04-04 00:46:39
|
Happy Birthday! ________________________________ From: Derrick Oswald <der...@gm...> To: htmlparser user list <htm...@li...> Sent: Sun, April 3, 2011 11:26:21 AM Subject: [Htmlparser-user] Happy Birthday! Today, the HTML Parser project marks its 10th year of existence. It has been downloaded over 395,612 times over its history. We hope it continues to provide the benefits that developers have enjoyed since it started - an easy to use, fast, flexible HTML parser. Thanks to all those who have contributed to the project - and to all those who have used it. |
From: Derrick O. <der...@gm...> - 2011-04-03 15:26:28
|
Today, the HTML Parser project marks its 10th year of existence. It has been downloaded over 395,612 times over its history. We hope it continues to provide the benefits that developers have enjoyed since it started - an easy to use, fast, flexible HTML parser. Thanks to all those who have contributed to the project - and to all those who have used it. |
From: mani k. <maj...@gm...> - 2011-01-26 11:50:36
|
Hi, I am a newbie to HTML parser. I am trying to use the parser to grab all the text with in a page. This is already implemented via the string extractor and string bean. But what i dont want is the content with in the <head> or any particular tag and its children(if required) in a HTML page. Can anyone help me on achieving this.? ALWAYS KEEP SMILING FOR U EVER, G.MANIKANDAN |
From: Prashanth <tan...@gm...> - 2011-01-24 02:22:13
|
HI, I am looking into a way of parsing http://finance.yahoo.com/q/op?s=AAPL&m=2011-02 I am lookng into grepping the data in the table and storing it on my local desktop. I downloaded HTMLParser-2.0-SNAPSHOT package but I am not sure of how to use this. I am a beginner to java programming so any help would be highly appreciated. Thanks Prashanth |
From: Bing Li <lb...@gm...> - 2011-01-22 19:23:32
|
Hi, all, Today I started to use HTML Parser. It works great! I got a question. In my system, I need to monitor the updates of thousands of URLs. I have to prepare a lot of Parsers to do that. I attempt to design a pool for the Parsers. However, I noticed that Parser has no the method that I can use to collect the garbage generated by Parsers. I don't need to care about that issue? Thanks so much! LB |
From: Andreas K. <lin...@gm...> - 2011-01-19 14:12:58
|
Solved - now it seems to work! Thanks a lot for all your help - I'm looking forward to using the htmlparser library! Best regards Andreas Den 19-01-2011 14:44, Derrick Oswald skrev: > You need to include the directory where the class file is on your classpath. > > On Jan 19, 2011 2:42 PM, "Andreas Kring" <lin...@gm... > <mailto:lin...@gm...>> wrote: > > Sorry, that was a typo from my side. I've also tried without the > > extension as you suggest, i.e. > > > > $ java -classpath /usr/share/java/libhtmlparser.jar test_htmlparser > > > > but this result in the error message below? > > > > Exception in thread "main" java.lang.NoClassDefFoundError: > test_htmlparser > > Caused by: java.lang.ClassNotFoundException: test_htmlparser > > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) > > at java.security.AccessController.doPrivileged(Native Method) > > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > > Could not find the main class: test_htmlparser. Program will exit. > > > > Thanks for your quick response by the way. > > > > /Andreas > > > > > > > > Den 19-01-2011 13:55, Derrick Oswald skrev: > >> Sorry, I didn't read closely enough. > >> When you issue the java command it needs no extension. > >> > >> $ java -classpath /usr/share/java/ libhtmlparser.jar test_htmlparser > >> > >> On Jan 19, 2011 10:42 AM, "Andreas Kring" <lin...@gm... > <mailto:lin...@gm...> > >> <mailto:lin...@gm... <mailto:lin...@gm...>>> > wrote: > >> > Thanks for your answer. It doesn't seem to work. I have tried both > >> > > >> > $ java -classpath /usr/share/java/libhtmlparser.jar > test_htmlparser.java > >> > > >> > and > >> > > >> > $ java -classpath .:/usr/share/java/libhtmlparser.jar > >> test_htmlparser.java > >> > > >> > Both of the commands result in the error message: > >> > > >> > Exception in thread "main" java.lang.NoClassDefFoundError: > >> > test_htmlparser/java > >> > Caused by: java.lang.ClassNotFoundException: test_htmlparser.java > >> > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) > >> > at java.security.AccessController.doPrivileged(Native Method) > >> > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > >> > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) > >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > >> > Could not find the main class: test_htmlparser.java. Program will > exit. > >> > > >> > I have also tried to > >> > > >> > $ export CLASSPATH=/usr/share/java/libhtmlparser.jar > >> > > >> > and the compile and run the program with > >> > > >> > $ javac test_htmlparser.java (which gives no errors) > >> > $ java test_htmlparser > >> > > >> > but I get the same error message as above... > >> > > >> > Is there something else I can try? > >> > > >> > Kind regards > >> > Andreas > >> > > >> > > >> > Den 19-01-2011 07:55, Derrick Oswald skrev: > >> >> Don't you need the classpath when you run it too? > >> >> > >> >> On Jan 18, 2011 11:46 PM, "Andreas Kring" > <lin...@gm... <mailto:lin...@gm...> > >> <mailto:lin...@gm... <mailto:lin...@gm...>> > >> >> <mailto:lin...@gm... > <mailto:lin...@gm...> <mailto:lin...@gm... > <mailto:lin...@gm...>>>> > >> wrote: > >> >> > Hello all. > >> >> > > >> >> > I have a newbie question that I hope you can help me with: > >> >> > I'm using Ubuntu 10.04 and I have just installed the package > >> >> > libhtmlparser-java. I get no errors when compiling the code below > >> >> > (test_htmlparser.java) using the command > >> >> > > >> >> > $ javac -classpath /usr/share/java/libhtmlparser.jar > >> test_htmlparser.java > >> >> > > >> >> > but when I try to run the program, I get the following error: > >> >> > > >> >> > $ java test_htmlparser > >> >> > Exception in thread "main" java.lang.NoClassDefFoundError: > >> >> > org/htmlparser/util/ParserException > >> >> > at test_htmlparser.main(test_htmlparser.java:12) > >> >> > Caused by: java.lang.ClassNotFoundException: > >> >> > org.htmlparser.util.ParserException > >> >> > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) > >> >> > at java.security.AccessController.doPrivileged(Native Method) > >> >> > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > >> >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > >> >> > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) > >> >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > >> >> > ... 1 more > >> >> > > >> >> > > >> >> > > >> >> > What can I do to fix this? > >> >> > > >> >> > /Andreas > >> >> > > >> >> > > >> >> > ----- test_htmlparser.java begin ----- > >> >> > > >> >> > import org.htmlparser.*; > >> >> > import org.htmlparser.util.*; > >> >> > > >> >> > class test_htmlparser > >> >> > { > >> >> > public static void main(String[] args) > >> >> > { > >> >> > try { > >> >> > Parser parser = new Parser("http://www.sslug.dk"); > >> >> > } catch (ParserException e) { > >> >> > System.err.println("Caught ParserException: " + e.getMessage()); > >> >> > } > >> >> > > >> >> > } > >> >> > } > >> >> > > >> >> > ----- test_htmlparser.java end ----- > >> >> > > >> >> > > >> >> > >> > ------------------------------------------------------------------------------ > >> >> > Protect Your Site and Customers from Malware Attacks > >> >> > Learn about various malware tactics and how to avoid them. > Understand > >> >> > malware threats, the impact they can have on your business, and > >> how you > >> >> > can protect your company and customers by using code signing. > >> >> > http://p.sf.net/sfu/oracle-sfdevnl > >> >> > _______________________________________________ > >> >> > Htmlparser-user mailing list > >> >> > Htm...@li... > <mailto:Htm...@li...> > >> <mailto:Htm...@li... > <mailto:Htm...@li...>> > >> >> <mailto:Htm...@li... > <mailto:Htm...@li...> > >> <mailto:Htm...@li... > <mailto:Htm...@li...>>> > >> >> > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > >> >> > >> >> > >> >> > >> >> > >> > ------------------------------------------------------------------------------ > >> >> Protect Your Site and Customers from Malware Attacks > >> >> Learn about various malware tactics and how to avoid them. Understand > >> >> malware threats, the impact they can have on your business, and > how you > >> >> can protect your company and customers by using code signing. > >> >> http://p.sf.net/sfu/oracle-sfdevnl > >> >> > >> >> > >> >> > >> >> _______________________________________________ > >> >> Htmlparser-user mailing list > >> >> Htm...@li... > <mailto:Htm...@li...> > >> <mailto:Htm...@li... > <mailto:Htm...@li...>> > >> >> https://lists.sourceforge.net/lists/listinfo/htmlparser-user > >> > > >> > > >> > > >> > ------------------------------------------------------------------------------ > >> > Protect Your Site and Customers from Malware Attacks > >> > Learn about various malware tactics and how to avoid them. Understand > >> > malware threats, the impact they can have on your business, and > how you > >> > can protect your company and customers by using code signing. > >> > http://p.sf.net/sfu/oracle-sfdevnl > >> > _______________________________________________ > >> > Htmlparser-user mailing list > >> > Htm...@li... > <mailto:Htm...@li...> > >> <mailto:Htm...@li... > <mailto:Htm...@li...>> > >> > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > >> > >> > >> > >> > ------------------------------------------------------------------------------ > >> Protect Your Site and Customers from Malware Attacks > >> Learn about various malware tactics and how to avoid them. Understand > >> malware threats, the impact they can have on your business, and how you > >> can protect your company and customers by using code signing. > >> http://p.sf.net/sfu/oracle-sfdevnl > >> > >> > >> > >> _______________________________________________ > >> Htmlparser-user mailing list > >> Htm...@li... > <mailto:Htm...@li...> > >> https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > > > > > ------------------------------------------------------------------------------ > > Protect Your Site and Customers from Malware Attacks > > Learn about various malware tactics and how to avoid them. Understand > > malware threats, the impact they can have on your business, and how you > > can protect your company and customers by using code signing. > > http://p.sf.net/sfu/oracle-sfdevnl > > _______________________________________________ > > Htmlparser-user mailing list > > Htm...@li... > <mailto:Htm...@li...> > > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > > > > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user |
From: Derrick O. <der...@gm...> - 2011-01-19 13:45:00
|
You need to include the directory where the class file is on your classpath. On Jan 19, 2011 2:42 PM, "Andreas Kring" <lin...@gm...> wrote: > Sorry, that was a typo from my side. I've also tried without the > extension as you suggest, i.e. > > $ java -classpath /usr/share/java/libhtmlparser.jar test_htmlparser > > but this result in the error message below? > > Exception in thread "main" java.lang.NoClassDefFoundError: test_htmlparser > Caused by: java.lang.ClassNotFoundException: test_htmlparser > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > Could not find the main class: test_htmlparser. Program will exit. > > Thanks for your quick response by the way. > > /Andreas > > > > Den 19-01-2011 13:55, Derrick Oswald skrev: >> Sorry, I didn't read closely enough. >> When you issue the java command it needs no extension. >> >> $ java -classpath /usr/share/java/ libhtmlparser.jar test_htmlparser >> >> On Jan 19, 2011 10:42 AM, "Andreas Kring" <lin...@gm... >> <mailto:lin...@gm...>> wrote: >> > Thanks for your answer. It doesn't seem to work. I have tried both >> > >> > $ java -classpath /usr/share/java/libhtmlparser.jar test_htmlparser.java >> > >> > and >> > >> > $ java -classpath .:/usr/share/java/libhtmlparser.jar >> test_htmlparser.java >> > >> > Both of the commands result in the error message: >> > >> > Exception in thread "main" java.lang.NoClassDefFoundError: >> > test_htmlparser/java >> > Caused by: java.lang.ClassNotFoundException: test_htmlparser.java >> > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) >> > at java.security.AccessController.doPrivileged(Native Method) >> > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) >> > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) >> > Could not find the main class: test_htmlparser.java. Program will exit. >> > >> > I have also tried to >> > >> > $ export CLASSPATH=/usr/share/java/libhtmlparser.jar >> > >> > and the compile and run the program with >> > >> > $ javac test_htmlparser.java (which gives no errors) >> > $ java test_htmlparser >> > >> > but I get the same error message as above... >> > >> > Is there something else I can try? >> > >> > Kind regards >> > Andreas >> > >> > >> > Den 19-01-2011 07:55, Derrick Oswald skrev: >> >> Don't you need the classpath when you run it too? >> >> >> >> On Jan 18, 2011 11:46 PM, "Andreas Kring" <lin...@gm... >> <mailto:lin...@gm...> >> >> <mailto:lin...@gm... <mailto:lin...@gm...>>> >> wrote: >> >> > Hello all. >> >> > >> >> > I have a newbie question that I hope you can help me with: >> >> > I'm using Ubuntu 10.04 and I have just installed the package >> >> > libhtmlparser-java. I get no errors when compiling the code below >> >> > (test_htmlparser.java) using the command >> >> > >> >> > $ javac -classpath /usr/share/java/libhtmlparser.jar >> test_htmlparser.java >> >> > >> >> > but when I try to run the program, I get the following error: >> >> > >> >> > $ java test_htmlparser >> >> > Exception in thread "main" java.lang.NoClassDefFoundError: >> >> > org/htmlparser/util/ParserException >> >> > at test_htmlparser.main(test_htmlparser.java:12) >> >> > Caused by: java.lang.ClassNotFoundException: >> >> > org.htmlparser.util.ParserException >> >> > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) >> >> > at java.security.AccessController.doPrivileged(Native Method) >> >> > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) >> >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) >> >> > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) >> >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) >> >> > ... 1 more >> >> > >> >> > >> >> > >> >> > What can I do to fix this? >> >> > >> >> > /Andreas >> >> > >> >> > >> >> > ----- test_htmlparser.java begin ----- >> >> > >> >> > import org.htmlparser.*; >> >> > import org.htmlparser.util.*; >> >> > >> >> > class test_htmlparser >> >> > { >> >> > public static void main(String[] args) >> >> > { >> >> > try { >> >> > Parser parser = new Parser("http://www.sslug.dk"); >> >> > } catch (ParserException e) { >> >> > System.err.println("Caught ParserException: " + e.getMessage()); >> >> > } >> >> > >> >> > } >> >> > } >> >> > >> >> > ----- test_htmlparser.java end ----- >> >> > >> >> > >> >> >> ------------------------------------------------------------------------------ >> >> > Protect Your Site and Customers from Malware Attacks >> >> > Learn about various malware tactics and how to avoid them. Understand >> >> > malware threats, the impact they can have on your business, and >> how you >> >> > can protect your company and customers by using code signing. >> >> > http://p.sf.net/sfu/oracle-sfdevnl >> >> > _______________________________________________ >> >> > Htmlparser-user mailing list >> >> > Htm...@li... >> <mailto:Htm...@li...> >> >> <mailto:Htm...@li... >> <mailto:Htm...@li...>> >> >> > https://lists.sourceforge.net/lists/listinfo/htmlparser-user >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> Protect Your Site and Customers from Malware Attacks >> >> Learn about various malware tactics and how to avoid them. Understand >> >> malware threats, the impact they can have on your business, and how you >> >> can protect your company and customers by using code signing. >> >> http://p.sf.net/sfu/oracle-sfdevnl >> >> >> >> >> >> >> >> _______________________________________________ >> >> Htmlparser-user mailing list >> >> Htm...@li... >> <mailto:Htm...@li...> >> >> https://lists.sourceforge.net/lists/listinfo/htmlparser-user >> > >> > >> > >> ------------------------------------------------------------------------------ >> > Protect Your Site and Customers from Malware Attacks >> > Learn about various malware tactics and how to avoid them. Understand >> > malware threats, the impact they can have on your business, and how you >> > can protect your company and customers by using code signing. >> > http://p.sf.net/sfu/oracle-sfdevnl >> > _______________________________________________ >> > Htmlparser-user mailing list >> > Htm...@li... >> <mailto:Htm...@li...> >> > https://lists.sourceforge.net/lists/listinfo/htmlparser-user >> >> >> >> ------------------------------------------------------------------------------ >> Protect Your Site and Customers from Malware Attacks >> Learn about various malware tactics and how to avoid them. Understand >> malware threats, the impact they can have on your business, and how you >> can protect your company and customers by using code signing. >> http://p.sf.net/sfu/oracle-sfdevnl >> >> >> >> _______________________________________________ >> Htmlparser-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user |
From: Andreas K. <lin...@gm...> - 2011-01-19 13:41:41
|
Sorry, that was a typo from my side. I've also tried without the extension as you suggest, i.e. $ java -classpath /usr/share/java/libhtmlparser.jar test_htmlparser but this result in the error message below? Exception in thread "main" java.lang.NoClassDefFoundError: test_htmlparser Caused by: java.lang.ClassNotFoundException: test_htmlparser at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) Could not find the main class: test_htmlparser. Program will exit. Thanks for your quick response by the way. /Andreas Den 19-01-2011 13:55, Derrick Oswald skrev: > Sorry, I didn't read closely enough. > When you issue the java command it needs no extension. > > $ java -classpath /usr/share/java/ libhtmlparser.jar test_htmlparser > > On Jan 19, 2011 10:42 AM, "Andreas Kring" <lin...@gm... > <mailto:lin...@gm...>> wrote: > > Thanks for your answer. It doesn't seem to work. I have tried both > > > > $ java -classpath /usr/share/java/libhtmlparser.jar test_htmlparser.java > > > > and > > > > $ java -classpath .:/usr/share/java/libhtmlparser.jar > test_htmlparser.java > > > > Both of the commands result in the error message: > > > > Exception in thread "main" java.lang.NoClassDefFoundError: > > test_htmlparser/java > > Caused by: java.lang.ClassNotFoundException: test_htmlparser.java > > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) > > at java.security.AccessController.doPrivileged(Native Method) > > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > > Could not find the main class: test_htmlparser.java. Program will exit. > > > > I have also tried to > > > > $ export CLASSPATH=/usr/share/java/libhtmlparser.jar > > > > and the compile and run the program with > > > > $ javac test_htmlparser.java (which gives no errors) > > $ java test_htmlparser > > > > but I get the same error message as above... > > > > Is there something else I can try? > > > > Kind regards > > Andreas > > > > > > Den 19-01-2011 07:55, Derrick Oswald skrev: > >> Don't you need the classpath when you run it too? > >> > >> On Jan 18, 2011 11:46 PM, "Andreas Kring" <lin...@gm... > <mailto:lin...@gm...> > >> <mailto:lin...@gm... <mailto:lin...@gm...>>> > wrote: > >> > Hello all. > >> > > >> > I have a newbie question that I hope you can help me with: > >> > I'm using Ubuntu 10.04 and I have just installed the package > >> > libhtmlparser-java. I get no errors when compiling the code below > >> > (test_htmlparser.java) using the command > >> > > >> > $ javac -classpath /usr/share/java/libhtmlparser.jar > test_htmlparser.java > >> > > >> > but when I try to run the program, I get the following error: > >> > > >> > $ java test_htmlparser > >> > Exception in thread "main" java.lang.NoClassDefFoundError: > >> > org/htmlparser/util/ParserException > >> > at test_htmlparser.main(test_htmlparser.java:12) > >> > Caused by: java.lang.ClassNotFoundException: > >> > org.htmlparser.util.ParserException > >> > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) > >> > at java.security.AccessController.doPrivileged(Native Method) > >> > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > >> > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) > >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > >> > ... 1 more > >> > > >> > > >> > > >> > What can I do to fix this? > >> > > >> > /Andreas > >> > > >> > > >> > ----- test_htmlparser.java begin ----- > >> > > >> > import org.htmlparser.*; > >> > import org.htmlparser.util.*; > >> > > >> > class test_htmlparser > >> > { > >> > public static void main(String[] args) > >> > { > >> > try { > >> > Parser parser = new Parser("http://www.sslug.dk"); > >> > } catch (ParserException e) { > >> > System.err.println("Caught ParserException: " + e.getMessage()); > >> > } > >> > > >> > } > >> > } > >> > > >> > ----- test_htmlparser.java end ----- > >> > > >> > > >> > ------------------------------------------------------------------------------ > >> > Protect Your Site and Customers from Malware Attacks > >> > Learn about various malware tactics and how to avoid them. Understand > >> > malware threats, the impact they can have on your business, and > how you > >> > can protect your company and customers by using code signing. > >> > http://p.sf.net/sfu/oracle-sfdevnl > >> > _______________________________________________ > >> > Htmlparser-user mailing list > >> > Htm...@li... > <mailto:Htm...@li...> > >> <mailto:Htm...@li... > <mailto:Htm...@li...>> > >> > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > >> > >> > >> > >> > ------------------------------------------------------------------------------ > >> Protect Your Site and Customers from Malware Attacks > >> Learn about various malware tactics and how to avoid them. Understand > >> malware threats, the impact they can have on your business, and how you > >> can protect your company and customers by using code signing. > >> http://p.sf.net/sfu/oracle-sfdevnl > >> > >> > >> > >> _______________________________________________ > >> Htmlparser-user mailing list > >> Htm...@li... > <mailto:Htm...@li...> > >> https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > > > > > ------------------------------------------------------------------------------ > > Protect Your Site and Customers from Malware Attacks > > Learn about various malware tactics and how to avoid them. Understand > > malware threats, the impact they can have on your business, and how you > > can protect your company and customers by using code signing. > > http://p.sf.net/sfu/oracle-sfdevnl > > _______________________________________________ > > Htmlparser-user mailing list > > Htm...@li... > <mailto:Htm...@li...> > > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > > > > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user |
From: Derrick O. <der...@gm...> - 2011-01-19 12:55:31
|
Sorry, I didn't read closely enough. When you issue the java command it needs no extension. $ java -classpath /usr/share/java/ libhtmlparser.jar test_htmlparser On Jan 19, 2011 10:42 AM, "Andreas Kring" <lin...@gm...> wrote: > Thanks for your answer. It doesn't seem to work. I have tried both > > $ java -classpath /usr/share/java/libhtmlparser.jar test_htmlparser.java > > and > > $ java -classpath .:/usr/share/java/libhtmlparser.jar test_htmlparser.java > > Both of the commands result in the error message: > > Exception in thread "main" java.lang.NoClassDefFoundError: > test_htmlparser/java > Caused by: java.lang.ClassNotFoundException: test_htmlparser.java > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > Could not find the main class: test_htmlparser.java. Program will exit. > > I have also tried to > > $ export CLASSPATH=/usr/share/java/libhtmlparser.jar > > and the compile and run the program with > > $ javac test_htmlparser.java (which gives no errors) > $ java test_htmlparser > > but I get the same error message as above... > > Is there something else I can try? > > Kind regards > Andreas > > > Den 19-01-2011 07:55, Derrick Oswald skrev: >> Don't you need the classpath when you run it too? >> >> On Jan 18, 2011 11:46 PM, "Andreas Kring" <lin...@gm... >> <mailto:lin...@gm...>> wrote: >> > Hello all. >> > >> > I have a newbie question that I hope you can help me with: >> > I'm using Ubuntu 10.04 and I have just installed the package >> > libhtmlparser-java. I get no errors when compiling the code below >> > (test_htmlparser.java) using the command >> > >> > $ javac -classpath /usr/share/java/libhtmlparser.jar test_htmlparser.java >> > >> > but when I try to run the program, I get the following error: >> > >> > $ java test_htmlparser >> > Exception in thread "main" java.lang.NoClassDefFoundError: >> > org/htmlparser/util/ParserException >> > at test_htmlparser.main(test_htmlparser.java:12) >> > Caused by: java.lang.ClassNotFoundException: >> > org.htmlparser.util.ParserException >> > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) >> > at java.security.AccessController.doPrivileged(Native Method) >> > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) >> > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) >> > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) >> > ... 1 more >> > >> > >> > >> > What can I do to fix this? >> > >> > /Andreas >> > >> > >> > ----- test_htmlparser.java begin ----- >> > >> > import org.htmlparser.*; >> > import org.htmlparser.util.*; >> > >> > class test_htmlparser >> > { >> > public static void main(String[] args) >> > { >> > try { >> > Parser parser = new Parser("http://www.sslug.dk"); >> > } catch (ParserException e) { >> > System.err.println("Caught ParserException: " + e.getMessage()); >> > } >> > >> > } >> > } >> > >> > ----- test_htmlparser.java end ----- >> > >> > >> ------------------------------------------------------------------------------ >> > Protect Your Site and Customers from Malware Attacks >> > Learn about various malware tactics and how to avoid them. Understand >> > malware threats, the impact they can have on your business, and how you >> > can protect your company and customers by using code signing. >> > http://p.sf.net/sfu/oracle-sfdevnl >> > _______________________________________________ >> > Htmlparser-user mailing list >> > Htm...@li... >> <mailto:Htm...@li...> >> > https://lists.sourceforge.net/lists/listinfo/htmlparser-user >> >> >> >> ------------------------------------------------------------------------------ >> Protect Your Site and Customers from Malware Attacks >> Learn about various malware tactics and how to avoid them. Understand >> malware threats, the impact they can have on your business, and how you >> can protect your company and customers by using code signing. >> http://p.sf.net/sfu/oracle-sfdevnl >> >> >> >> _______________________________________________ >> Htmlparser-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user |
From: Andreas K. <lin...@gm...> - 2011-01-19 09:41:34
|
Thanks for your answer. It doesn't seem to work. I have tried both $ java -classpath /usr/share/java/libhtmlparser.jar test_htmlparser.java and $ java -classpath .:/usr/share/java/libhtmlparser.jar test_htmlparser.java Both of the commands result in the error message: Exception in thread "main" java.lang.NoClassDefFoundError: test_htmlparser/java Caused by: java.lang.ClassNotFoundException: test_htmlparser.java at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) Could not find the main class: test_htmlparser.java. Program will exit. I have also tried to $ export CLASSPATH=/usr/share/java/libhtmlparser.jar and the compile and run the program with $ javac test_htmlparser.java (which gives no errors) $ java test_htmlparser but I get the same error message as above... Is there something else I can try? Kind regards Andreas Den 19-01-2011 07:55, Derrick Oswald skrev: > Don't you need the classpath when you run it too? > > On Jan 18, 2011 11:46 PM, "Andreas Kring" <lin...@gm... > <mailto:lin...@gm...>> wrote: > > Hello all. > > > > I have a newbie question that I hope you can help me with: > > I'm using Ubuntu 10.04 and I have just installed the package > > libhtmlparser-java. I get no errors when compiling the code below > > (test_htmlparser.java) using the command > > > > $ javac -classpath /usr/share/java/libhtmlparser.jar test_htmlparser.java > > > > but when I try to run the program, I get the following error: > > > > $ java test_htmlparser > > Exception in thread "main" java.lang.NoClassDefFoundError: > > org/htmlparser/util/ParserException > > at test_htmlparser.main(test_htmlparser.java:12) > > Caused by: java.lang.ClassNotFoundException: > > org.htmlparser.util.ParserException > > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) > > at java.security.AccessController.doPrivileged(Native Method) > > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > > ... 1 more > > > > > > > > What can I do to fix this? > > > > /Andreas > > > > > > ----- test_htmlparser.java begin ----- > > > > import org.htmlparser.*; > > import org.htmlparser.util.*; > > > > class test_htmlparser > > { > > public static void main(String[] args) > > { > > try { > > Parser parser = new Parser("http://www.sslug.dk"); > > } catch (ParserException e) { > > System.err.println("Caught ParserException: " + e.getMessage()); > > } > > > > } > > } > > > > ----- test_htmlparser.java end ----- > > > > > ------------------------------------------------------------------------------ > > Protect Your Site and Customers from Malware Attacks > > Learn about various malware tactics and how to avoid them. Understand > > malware threats, the impact they can have on your business, and how you > > can protect your company and customers by using code signing. > > http://p.sf.net/sfu/oracle-sfdevnl > > _______________________________________________ > > Htmlparser-user mailing list > > Htm...@li... > <mailto:Htm...@li...> > > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > > > > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user |
From: Derrick O. <der...@gm...> - 2011-01-19 06:55:44
|
Don't you need the classpath when you run it too? On Jan 18, 2011 11:46 PM, "Andreas Kring" <lin...@gm...> wrote: > Hello all. > > I have a newbie question that I hope you can help me with: > I'm using Ubuntu 10.04 and I have just installed the package > libhtmlparser-java. I get no errors when compiling the code below > (test_htmlparser.java) using the command > > $ javac -classpath /usr/share/java/libhtmlparser.jar test_htmlparser.java > > but when I try to run the program, I get the following error: > > $ java test_htmlparser > Exception in thread "main" java.lang.NoClassDefFoundError: > org/htmlparser/util/ParserException > at test_htmlparser.main(test_htmlparser.java:12) > Caused by: java.lang.ClassNotFoundException: > org.htmlparser.util.ParserException > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > ... 1 more > > > > What can I do to fix this? > > /Andreas > > > ----- test_htmlparser.java begin ----- > > import org.htmlparser.*; > import org.htmlparser.util.*; > > class test_htmlparser > { > public static void main(String[] args) > { > try { > Parser parser = new Parser("http://www.sslug.dk"); > } catch (ParserException e) { > System.err.println("Caught ParserException: " + e.getMessage()); > } > > } > } > > ----- test_htmlparser.java end ----- > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user |
From: Andreas K. <lin...@gm...> - 2011-01-18 22:45:26
|
Hello all. I have a newbie question that I hope you can help me with: I'm using Ubuntu 10.04 and I have just installed the package libhtmlparser-java. I get no errors when compiling the code below (test_htmlparser.java) using the command $ javac -classpath /usr/share/java/libhtmlparser.jar test_htmlparser.java but when I try to run the program, I get the following error: $ java test_htmlparser Exception in thread "main" java.lang.NoClassDefFoundError: org/htmlparser/util/ParserException at test_htmlparser.main(test_htmlparser.java:12) Caused by: java.lang.ClassNotFoundException: org.htmlparser.util.ParserException at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) ... 1 more What can I do to fix this? /Andreas ----- test_htmlparser.java begin ----- import org.htmlparser.*; import org.htmlparser.util.*; class test_htmlparser { public static void main(String[] args) { try { Parser parser = new Parser("http://www.sslug.dk"); } catch (ParserException e) { System.err.println("Caught ParserException: " + e.getMessage()); } } } ----- test_htmlparser.java end ----- |
From: Derrick O. <der...@gm...> - 2011-01-13 12:56:10
|
You could have a look at the Thumbelina example that does that at the lexer level. On Jan 13, 2011 7:39 AM, "mani kandan" <maj...@gm...> wrote: > Hi, > > I am new to the HTML parser. I am trying to use the parse to grab all the > images referred in the page. can you please help me how to do that. ? > > -- > ALWAYS KEEP SMILING > > FOR U EVER, > > G.MANIKANDAN |