I am looking for a value "Not found" but my code is not finding it. Instead if the value is Not Found it just crashes
here is the code
for key, value in productLinks.iteritems():
if value is "Not Found":
print value
else:
print value
html = urllib2.urlopen(value)
soup = BS(html)
foundPrice = soup.find('s')
if found is not None:
print "found a price"
else:
print" No Lunk"
here is the error
Traceback (most recent call last):
File "asimsScrapper.py", line 28, in <module>
html = urllib2.urlopen(value)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 386, in open
protocol = req.get_type()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 248, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: Not found