MCPcopy
hub / github.com/scrapinghub/splash / node_method

Method node_method

splash/html_element.py:131–142  ·  view source on GitHub ↗

Return function which calls the specified method of the element

(self, method_name)

Source from the content-addressed store, hash-verified

129 ))
130
131 def node_method(self, method_name):
132 """ Return function which calls the specified method of the element """
133 method_name = escape_js(method_name)
134 @empty_strings_as_none
135 def call(*args):
136 return self.tab.evaljs(u"{element}[{method}]({args})".format(
137 element=self.element_js,
138 method=method_name,
139 args=escape_js_args(*args)
140 ))
141
142 return call
143
144 @contextmanager
145 def _in_viewport(self, disable=False, scroll_back=True):

Callers 3

_in_viewportMethod · 0.95
submitMethod · 0.95
_node_methodMethod · 0.80

Calls 1

escape_jsFunction · 0.90

Tested by

no test coverage detected