#!/usr/local/bin/python3.sh # -*-mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -* import sys import os import traceback from phantompy import Render global LOG import logging import warnings warnings.filterwarnings('ignore') LOG = logging.getLogger() class LookFor(Render): def __init__(self, url, outfile, jsfile=None): self.uri = url Render.__init__(self, url, outfile, jsfile) def ilookfor(self, html): import json marker = '
'
      if marker not in html: return ''
      i = html.find(marker) + len(marker)
      html = html[i:]
      assert html[0] == '{', html
      i = html.find('  []")
  else:
    url = sys.argv[1]
    outfile = sys.argv[2]
    jsfile = sys.argv[3] if len(sys.argv) > 3 else None
    r = LookFor(url, outfile, jsfile)

  sys.exit(0)

if __name__ == "__main__":
  main()