• Post Reply Bookmark Topic Watch Topic
  • New Topic

Search text in HTML  RSS feed

 
Seema Sharma
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Please let me know how to search text in HTML using swings.

Regards,
Seema
 
Rob Spoor
Sheriff
Posts: 21052
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Please let me know what you've done so far.
ShowSomeEffort
SearchFirst
[ August 21, 2008: Message edited by: Rob Prime ]
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you asking about files you have stored locally, about spidering the web, or about searching a few particular web sites?

Either way, this has nothing to do with Swing, it's about networking and text processing. Also note that SwingIsAProperNoun.
 
Seema Sharma
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to read HTML file and based on the search text entered , i need to find that text in the HTML file.

Yes, i am trying to read the HTML file stored locally.
First step i did is reading the HTML file. The program is below:



But exception occurs "java.io.FileNotFoundException". Please help me.

Thanks,
Seema
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is "d://Hello.htm" a valid file path, and does the code have the right to access it? A common cause for FileNotFoundException are missing access privileges.

I'm not sure what keeping the HTML in a JEditorPane adds to searching it, but be aware that that class only supports HTML 3.2, so many HTML features (including CSS) will not be rendered correctly or at all.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!