R_Milligan3

Try/Except Error

Jul 5th, 2022
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. while True:
  2. try:
  3. results = api.search(item)
  4. print("Total Machines ={}".format(results['total']))
  5. for x in results['matches']:
  6. myFind.append(str(x['ip_str'])
  7. except Exception as e:
  8. print(e)
  9.  
  10. # I've also tried :
  11.  
  12. while True:
  13. try:
  14. results = api.search(item)
  15. print("Total Machines ={}".format(results['total']))
  16. for x in results['matches']:
  17. myFind.append(str(x['ip_str'])
  18. except:
  19. print("Error")
  20.  
  21. Error Message reads:
  22. File "./Shodan_Output.py", line 24
  23. except Exception as e:
  24. ^
  25. SyntaxError: invalid syntax
  26.  
Advertisement
Add Comment
Please, Sign In to add comment