Browser function: recording history

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Browser function: recording history

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does a browser's history record?
A The URLs of web pages the user has visited
B The passwords for every website on the internet
2. Mia read a page about DNS yesterday and cannot remember its address. Which browser function helps her find it?
A Browser history
B The refresh button
3. Browser history usually shows pages together with which extra detail?
A The date they were visited
B The IP address of the user's router
4. Which statement about clearing history is correct?
A It cannot be removed once it has been recorded
B The user can clear it to delete the list of visited pages
5. Noah shares a computer with his brother and does not want him to see which sites he visited. What should Noah do?
A Add every page to bookmarks
B Clear the browser history

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1browser history Ahistory: 12/03 https://www.bbc.co.uk/news
2Clear browsing data BClear history: delete all entries
3The browser stores each visited URL with the date, so you can find a page you saw last week CA list of the URLs of pages you have visited, usually with the dates, so you can find them again
4A user can remove the record of visited pages so other people using the device cannot see them DHistory only records the URLs (and dates) of pages visited. It does not store passwords or the content typed into pages.
5History stores the passwords and text typed into every web page EClearing history only deletes the list of visited pages. The browser still works and can load pages as normal.
6Clearing history stops the browser from loading any web pages FA browser option that deletes the saved list of visited pages from the history

Definitions

browser history

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
_______.add(url, date)
2.
history.add(___, date)
3.
history.add(url, ____)
4.
results = history.______("shop")
5.
history._____()

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A history = ()
B url = "www.bbc.co.uk"
C history.append(url)
Question 2
A history = []
B history.add("a.com")
C print(history)
Question 3
A history = ["a.com", "b.com"]
B for url in history:
C print(url
Question 4
A history = ["a.com", "b.com"]
B search = "b.com"
C if search in history:
D print(Found it again)
E else:
F print("Not visited")
Question 5
A history = ["a.com", "b.com"]
B print(len(history))
C history.pop()
D print(len(history))

Answer Key

Browser function: recording history
Section A: Quick Questions
Q1
A — The URLs of web pages the user has visited
Q2
A — Browser history
Q3
A — The date they were visited
Q4
B — The user can clear it to delete the list of visited pages
Q5
B — Clear the browser history
Section B: Match the Pairs
Q1
browser history → A list of the URLs of pages you have visited, usually with the dates, so you can find them again
Q2
Clear browsing data → A browser option that deletes the saved list of visited pages from the history
Q3
The browser stores each visited URL with the date, so you can find a page you saw last week → history: 12/03 https://www.bbc.co.uk/news
Q4
A user can remove the record of visited pages so other people using the device cannot see them → Clear history: delete all entries
Q5
History stores the passwords and text typed into every web page → History only records the URLs (and dates) of pages visited. It does not store passwords or the content typed into pages.
Q6
Clearing history stops the browser from loading any web pages → Clearing history only deletes the list of visited pages. The browser still works and can load pages as normal.
Section C: Definitions
Q1
browser history — A list of the URLs of web pages a user has visited, usually with dates, so they can find a page again. The user can clear it.
Section D: Fill in the Blanks
Q1
history.add(url, date)
Q2
history.add(url, date)
Q3
history.add(url, date)
Q4
results = history.search("shop")
Q5
history.clear()
Section E: Spot the Error
Q1
A — A browser history grows as pages are visited, so it needs a list. A tuple () cannot be added to, so append would fail. It should be history = [].
Q2
B — Lists have no add method. To record a visited URL at the end of the history list you use append, so it should be history.append("a.com").
Q3
C — The closing bracket is missing, so the line is a syntax error. Showing the list of visited pages needs print(url).
Q4
D — The message is missing its quote marks, so Python treats the words as code and gives an error. It should be print("Found it again").
Q5
C — pop() removes only the last page. Clearing history removes every visited page, so it should be history.clear().