Solved

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

Posted on 2003-12-04
3
253 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

770 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