/A-Key-Filter

Worksheet 8 Networking Programming Write a program to check whether or not a webpage contains certain keywords, without showing the webpage to the user

Primary LanguagePython

July 2022 Computer Sciences: Programming (CIS1048-N) by Teesside University

Worksheet 8 Networking Programming

[ASSESSMENT] Question 2: A Keyword Filter (keyword_filter.py) Let’s now write a program to check whether or not a webpage contains certain keywords, without showing the webpage to the user.

  1. Write a program that asks the user for the address of a webpage.
  2. Now, read a list of “blocked words” from a file blocked_words.txt line-by-line.
  3. Download the contents of that webpage to a string, and print a message that access to the webpage has been blocked if the webpage’s source code contains any word in blocked_words.txt.