예제 #1
0
class Model_Pylogic_V8:
    def __init__(self):
        self.parser = HtmlParser()

    def fetch(self, url, script="function(doc, wnd){}"):
        _script = "exports = require('object.h').stringify((" + script + ")(document, window));"
        r = self.parser.parse(url, script=_script)
        if (r):
            r = json.loads(r)
        return r

    def test(self):
        return "test"
예제 #2
0
파일: v8.py 프로젝트: ivershuo/weizoophoto
class Model_Pylogic_V8:
	def __init__(self):
		self.parser = HtmlParser()

	def fetch(self, url, script="function(doc, wnd){}"):
		_script = "exports = require('object.h').stringify((" + script + ")(document, window));"
		r = self.parser.parse(url, script=_script)
		if(r):
			r = json.loads(r)
		return r

	def test(self):
		return "test"
예제 #3
0
 def __init__(self):
     self.parser = HtmlParser()
예제 #4
0
파일: v8.py 프로젝트: ivershuo/weizoophoto
	def __init__(self):
		self.parser = HtmlParser()