Thanks in particular to
Benibela, I have managed to use
InternetTools to get the desired webpage into a string, like this:
P := httpRequest('http://www.planespotters.net/search.php?q=' + Edit1.Text);It is much easier to construct the URL to the search term in code than attempt to fill in input controls which just have the same result.
I then extract the data I want from the page with a series of fairly straightforward GetPart() text extractions. It all works and surprisingly quickly.
However, I am struggling to log in to the site. Fortunately I only need to log in if I exceed a certain number of lookups, which is OK for testing. Benibela provided this code:
httpRequest(process('...portal.asp?', 'form((//form)[1], {"userid": "me", "pwd": "password"})'))I copied and pasted this into a new ButtonClick procedure and changed the URL, "userid" to "username", and "pwd" to "password", these being the element names that worked in the Basic4Android version of my program (this sends javascript to the login page). And obviously I changed "me" and "password" to my actual username and password, but shown as @ symbols below. This resulted in:
httpRequest(process('http://www.planespotters.net/login.php', 'form((//form)[1], {"username": "@@@@", "password": "@@@@"})'));However on clicking the button I got the following error message (with my username and password changed again):
Debugger Exception Notification
Project project1 raised exception class 'EXQParsingException' with message:
err:XPST003: Unexpected{,(Enable json extension, to create a json like object)
in form((//form){1],{[<- error occurs before here] "username"; "@@@@", "password": "@@@@"})
In file '.data\xquery_parse.inc' at line 90:
RaiseEXQParsingException.Create(errcode,s+#13#10'in: + 'strslice(@str[1],pos-1)+'[<- error occurs before here]'+strslice(pos,@str[length(str)]));
If anyone knows how to copy the contents of one of these notifications to the clipboard, please let me know, typing the above took forever and may not be perfectly accurate ! Needless to say, I don't have a clue what it is about. So, is there an error in the quoted code?
Also I do not understand how this code can trigger the login button. If it helps, the login page is
http://www.planespotters.net/login.php and you can of course use your browser to view the code.
I would be most grateful for a solution. Many thanks.
Caravelle