Fix mgstage source error Exception handling
This commit is contained in:
@@ -114,6 +114,7 @@ def main(number2):
|
||||
a = str(soup.find(attrs={'class': 'detail_data'})).replace('\n ','').replace(' ','').replace('\n ','').replace('\n ','')
|
||||
b = str(soup.find(attrs={'id': 'introduction'})).replace('\n ','').replace(' ','').replace('\n ','').replace('\n ','')
|
||||
#print(b)
|
||||
try:
|
||||
dic = {
|
||||
'title': getTitle(htmlcode).replace("\\n", '').replace(' ', ''),
|
||||
'studio': getStudio(a),
|
||||
@@ -134,9 +135,11 @@ def main(number2):
|
||||
'source': 'mgstage.py',
|
||||
'series': getSeries(a),
|
||||
}
|
||||
except:
|
||||
dic = {"title": ""}
|
||||
|
||||
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8')
|
||||
return js
|
||||
#print(htmlcode)
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(main('SIRO-4149'))
|
||||
|
||||
Reference in New Issue
Block a user