from browser_history import get_history
outputs = get_history()
# his is a list of (datetime.datetime, url) tuples
his = outputs.histories[0:10]
for i in his:
print(i)
print("history length",len(his))
from browser_history import get_history
# Get the browser history from the get_history function
history = get_history().histories
# Create a new list to store the unique history
unique_history = []
# Iterate over the history list
for i in history:
# Get the URL from the current history item
url = i[1]
# Check if the URL is already in the unique_history list
if url in unique_history:
# If it is, skip to the next iteration
continue
# If it's not, add it to the unique_history list
unique_history.append(url)
# Print the last 10 elements of the unique_history list
print(unique_history[-10:])
1条答案
按热度按时间s2j5cfk01#
这应该能帮你找到你要找的东西。