Changeset 24 for trunk


Ignore:
Timestamp:
02/15/07 18:26:39 (18 years ago)
Author:
atzm
Message:
  • Fixed a bug occured when Amazon returned no valid data
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/amazonbot/my_amazon.py

    r8 r24  
    291291    u = urllib.FancyURLopener(proxies) 
    292292    usock = u.open(url) 
    293     xmldoc = minidom.parse(usock) 
     293    xmldoc = None 
     294    try: 
     295        xmldoc = minidom.parse(usock) 
     296    except: 
     297        raise AmazonError, 'XML Parsing Error' 
     298    if xmldoc is None: 
     299        raise AmazonError, 'XML Parsing Error (Result is None)' 
    294300 
    295301#     from xml.dom.ext import PrettyPrint 
Note: See TracChangeset for help on using the changeset viewer.