how the hell do you parse java?

wasssup

Diamond Member
Nov 28, 2000
3,142
0
0
So i'm working on a last minute program (and later I gotta cram for an exam), and i'm almost done, but the thing is I don't know how to parse html in java :|

I can stream it to standard output, but that's it...
 

AgentEL

Golden Member
Jun 25, 2001
1,327
0
0
I don't have much experience with it, but have you looked at the HTMLDocument class provided in the Java API?
 

johnjbruin

Diamond Member
Jul 17, 2001
4,401
1
0
Originally posted by: BingBongWongFooey
Originally posted by: notfred
Originally posted by: BingBongWongFooey
"parse in java", not "parse java"

<-pedant ;)

Seriously though, I thought he wanted to write a java compiler.

me too. :D

me three.

to the OP - look at the java html classes - they will definitely be helpful.
 

wasssup

Diamond Member
Nov 28, 2000
3,142
0
0
err i can barely code a simple java program, let's just forget about coding a compiler :)

I figured it out though, and i'm like 99% done with this part of the program (the main part, yay); HOWEVER upon trying it out on several different yet similar sources, it looks like I have to return the index of the nth occurance of a text string. I know of indexOf() and lastIndexOf(), but obviously these won't return the index of the nth occurance...

It wouldn't be stringterm(), would it? I've been googling for the last hour or so trying to figure this out :( ..the one java book I own seems to suck ass.
 

Kilrsat

Golden Member
Jul 16, 2001
1,072
0
0
Originally posted by: wasssup
err i can barely code a simple java program, let's just forget about coding a compiler :)

I figured it out though, and i'm like 99% done with this part of the program (the main part, yay); HOWEVER upon trying it out on several different yet similar sources, it looks like I have to return the index of the nth occurance of a text string. I know of indexOf() and lastIndexOf(), but obviously these won't return the index of the nth occurance...

It wouldn't be stringterm(), would it? I've been googling for the last hour or so trying to figure this out :( ..the one java book I own seems to suck ass.
This will find the start of the nth occurance
 

wasssup

Diamond Member
Nov 28, 2000
3,142
0
0
thanks Kilrsat, that worked perfectly :)

now I just have another (basic) problem to figure out and i think i'll be able to finish this problem..i'll post it in a new thread because this problem has been solved :D