data from a web page and prints all hyperlinks of the form a href-"link">link text</> Extra credit if your program can follow the links that it finds and find links in those web pages as well. (This is the method that search engines such as Google use to find web sites.) Topic 7.1 Reading Web Pages You can read the contents of a web page with this sequence of commands: String address- "http://horstnann.com/index.htal": URL pagelocation - new URLCaddress); Scanner in ne Scanner (pagelocation.openStreanO): Now simply read the contents of the web page with the Scan- ner in the usual way. The URL constructor and the openstrean method can throw an 10Exception, so you need to tag the nain method with throws 10Exception. (See Section 7.4.3 for more information on the throws clause.) The URL class is contained in the java.net package.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 12E
icon
Related questions
Question
100%

java

Using the mechanism described in Special Topic 7.1, write a program that reads all
data from a web page and prints all hyperlinks of the form
a href-"link">link text</a>
Extra credit if your program can follow the links that it finds and find links in those
web pages as well. (This is the method that search engines such as Google use to find
web sites.)
Special Topic 7.1 Reading Web Pages
You can read the contents of a web page with this sequence of commands:
String address - "http://horstmann.com/index.html";
URL pagelocation - new URL(address);
Scanner in - new Scanner(pagelocation.openStream0);
Now simply read the contents of the web page with the Scan-
ner in the usual way. The URL constructor and the openStrean
method can throw an 10Exception, so you need to tag the nain
method with throws I0Exception. (Sece Section 7.4.3 for more
information on the throws clause.)
The URL class is contained in the java.net package.
Transcribed Image Text:Using the mechanism described in Special Topic 7.1, write a program that reads all data from a web page and prints all hyperlinks of the form a href-"link">link text</a> Extra credit if your program can follow the links that it finds and find links in those web pages as well. (This is the method that search engines such as Google use to find web sites.) Special Topic 7.1 Reading Web Pages You can read the contents of a web page with this sequence of commands: String address - "http://horstmann.com/index.html"; URL pagelocation - new URL(address); Scanner in - new Scanner(pagelocation.openStream0); Now simply read the contents of the web page with the Scan- ner in the usual way. The URL constructor and the openStrean method can throw an 10Exception, so you need to tag the nain method with throws I0Exception. (Sece Section 7.4.3 for more information on the throws clause.) The URL class is contained in the java.net package.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,