code: def main():
      try:
          htmlTree = get_html()
          table = find_table(htmlTree)
          if table is None:
              raise Exception(
                  "S&P 500 Component Stocks table not found"
              )
          symbolsXML = parse_results(table)
  
          logger.info("Writing sp500.xml")
          symbolsXML.write("sp500.xml")
      except Exception as e:
          logger.error(str(e))
  
imports: import sys
  import pyalgotrade.logger
  import lxml.html
  import symbolsxml
label_desc: Use image node_id 4 for calling a global function with example usage: main() without return types