WildProofGear
Vendor
My job is to get a listing of named features from any web-page using Python. There are some scripts in other languages that do exactly what I need.
When web page is packed I can run the manuscript from JS console (e.g. from dev-tools in GoogleChrome). I have the selection of names of the features as the outcome. Well, however I most likely to the page and perform the manuscript from internet browser manually. However the concern is to do the very same from Python. It can look something like this:
[tt]def get_named_functions_list(url):
myscript = settings.get_js_code() # here I get script that I told above
tool.open(url)
while not tool.document.READY: # here I wait while the page will completely loaded
pass
js_result = tool.execute_from_console(myscript)
return list(js_result.values())
def main():
url = " get_named_functions_list(url)
[/tt]
The result what I want:
1. Request given URL
2. Wait for function document.ready() will finished.
3. Execute javascript on the page (like in browser).
4. Getting of result the JS-code returns.
When web page is packed I can run the manuscript from JS console (e.g. from dev-tools in GoogleChrome). I have the selection of names of the features as the outcome. Well, however I most likely to the page and perform the manuscript from internet browser manually. However the concern is to do the very same from Python. It can look something like this:
[tt]def get_named_functions_list(url):
myscript = settings.get_js_code() # here I get script that I told above
tool.open(url)
while not tool.document.READY: # here I wait while the page will completely loaded
pass
js_result = tool.execute_from_console(myscript)
return list(js_result.values())
def main():
url = " get_named_functions_list(url)
[/tt]
The result what I want:
1. Request given URL
2. Wait for function document.ready() will finished.
3. Execute javascript on the page (like in browser).
4. Getting of result the JS-code returns.