Hello everyone I am trying to print to the console the html of url. I took the code from tutorial.py that free in the open source. That is the class:
class LoadHandler(object):
def OnLoadingStateChange(self, browser, is_loading, **_):
"""Called when the loading state has changed."""
if not is_loading:
# Loading is complete. DOM is ready.
# js_print(browser, "Python", "OnLoadingStateChange", "Loading is complete")
print('ready')
print(browser.GetMainFrame().GetText())
and I added the two last lines:
print('ready')
print(browser.GetMainFrame().GetText())
When I run the code I get an ERROR massage:
TypeError: GetText() takes exactly one argument (0 given)
I saw in the documentation that I need to give to the function parameter StringVisitor
(https://github.com/cztomczak/cefpython/blob/master/api/Frame.md#gettext)
What is the StringVisitor
and how can I solve this problem?