hello.I wrote this code but when it reads a url which doesn't have my two conds it shows me an error?what do I should do if i want to pass the error?(I want this:If it sees everything except my conds pass it)
Code:
import urllib2
f = open ("/home/mj/Desktop/test.txt")

for line in f:
    request = urllib2.Request(line)
    request.add_header('User-agent', 'firefox')
    response = urllib2.urlopen(request)
    data = response.read(request)
    if "word" in data:
      with open("/home/mj/Desktop/test1.txt", "a") as myfile:
        myfile.write(line)
    else:
      if "word1" in data:
        with open("/home/mj/Desktop/test1.txt", "a") as myfile:
          myfile.write(line)
      else:
(what sould i write?)