Automation with WebView
Posted
#1
(In Topic #1310)
Trainee

I would like to log in to a web site automatically, to push buttons under program control, etc.
Also how does WebView handle cookies?
Posted
Banned
Usually it's done using JavaScript
WebView.ExecJavascript() method.
Posted
Trainee

This page says it does have it: /comp/gb.qt5.webview/webview - Gambas Documentation
Any idea what have I done wrong?
Posted
Banned
Posted
Trainee

Posted
Banned
My guess would be that you are not using gb.gui.webview but using the old gb.qt.webkit
gb.qt.webkit (that was QT only) is now depreciated so you should use gb.gui.webview (QT and GTK) instead
/comp-deprecated - Gambas Documentation : do not use these ones
/comp - Gambas Documentation : use these.
Ps. your code could be showing an old error (Error.code and Error.text may be filled from a previous error not the last Try)
You should do it like this…
I get this result..
-1
Javascript error: undefined:1:4: ReferenceError: Can't find variable: abc
And that's correct as "abc" is invalid javascript
Posted
Trainee

Thank you very much.
Posted
Regular

Path override failed for key base:
Path override failed for key base:
Path override failed for key base:
js: Uncaught ReferenceError: abc is not defined
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Banned
vuott said
By using QT6, I obtain in console:
Path override failed for key base:IR_APP_DICTIONARIES and path '/usr/bin/qtwebengine_dictionaries'
Path override failed for key base:IR_APP_DICTIONARIES and path '/usr/lib/qt6/qtwebengine_dictionaries'
Path override failed for key base:IR_APP_DICTIONARIES and path '/usr/lib/qt6/qtwebengine_dictionaries'
js: Uncaught ReferenceError: abc is not defined
ooh your qt6 doesn't seem too happy. looks like spell checker config issue.
Posted
Regular

Hi BruceSteers,BruceSteers said
ooh your qt6 doesn't seem too happy.
…evidently my QT6 has not yet learnt that life can be bitter !
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
1 guest and 0 members have just viewed this.





