Solved

Open a URL, scan the page(look for certain words)

Posted on 2003-12-04
3
269 Views
Last Modified: 2010-04-17
Hi

In java, how can I open an URL eg. http://www.google.com , then read that page meaning
search for certain words..and if those words exist I would output a message.

SB

0
Comment
Question by:ScarletBlue
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Accepted Solution

by:
override_y2k earned 20 total points
ID: 9876661
Do something like

String url = "http://yahoo.com

Then use javas openURL command to open it

........
    try {
    someutility.openURL(url);
    return;      
    }
........            

Also you will need to catch various exceptions.Then create a search tool that searches the page for a given word.

......
if(wordpresent = true) {
  System.out.println("Word is present");
}
....

Regards.

O2K
0
 

Author Comment

by:ScarletBlue
ID: 10319544
Hi CleanupPing
I have already accepted O2K's answer. It's written "Accepted Answer " in green. Please
confirm this.
thanx
scarlet
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Progress

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question