In this activity you will test the WebReader class explained in Unit 9, which allows you to display the HTML source of a web page.
In addition to the Solution document, the project for this exercise contains two classes, which are complete:
The project also contains an html file with additional advice on how to adjust the settings of firewall software that you may have installed on your machine and to stop it from interfering with your network programming activities throughout this unit.
You are to use the WebReader class to connect to the home page of the Open University website and display its HTML source. You are also to connect to the same web page using a browser and compare the source.
First, make sure you are connected to the internet. If you are using a dial-up link, you should have dialled in and established a link. Now run the project - this should display the HTML source for the home page of the Open University at the URL specified in the main method of the class TestWebReader
Use a browser to view the same web page as before. Use the View Source option to look at the HTML source of this page. It should be the same as the output from the TestWebReader program
Edit the URL specified in the main method of the class TestWebReader so that it refers to a different web page whose URL you know. Run the program again and check whether the output is as you would expect.