The conversation between human and AI assistant.
How do I check if a page is active and no 404 error is shown in selenium?
Can you show me an example code snippet for this?
Sure! Here's an example:

from selenium import webdriver

driver = webdriver.Chrome()

driver.get("https://www.example.com")

if "404" in driver.page_source:
    print("404 error found")
else:
    print("Page is active, no 404 error found")