Page 1 of 1

Read text from Webgadget

Posted: Wed May 24, 2023 5:20 pm
by bmld76
Hello,
I want to read the text from an HTML page. httprequest work only on the local domain and ReceiveHTTPMemory don't exist in SpiderBasic. I use a web gadget. Do you know how to read the text from a webgaget. Thank.

answer of my test program :
Retour <head></head><body></body>
Retour undefined
Retour
Retour
Retour
Retour http://bmaillard.free.fr/spider/requette.php

test program

Code: Select all

#Window           = 0
#SendStringGadget  = 0
#HTMLGadget       = 50

Procedure Events()
  Select Event()
    Case #PB_Event_Gadget
      
      Select EventGadget()
        Case #SendStringGadget 
          WebGadget(#HTMLGadget, 10, 50, 580, 180, "http://bmaillard.free.fr/spider/requette.php") 
          Debug " "+ #PB_Web_HtmlCode + " " + #PB_Web_SelectedText
         For i = 1 To 5
            Result$ = GetGadgetItemText(#HTMLGadget,i )
            Debug "Retour " + result$
            Next
            Result$ = GetGadgetText(#HTMLGadget)
            Debug "Retour " + result$
      EndSelect
      
  EndSelect
  
EndProcedure

BindEvent(#PB_Event_Gadget, @Events())
BindEvent(#PB_Event_WebSocket, @Events())

OpenWindow(#Window, 100, 100, 600, 400, "WebSocket test")
ButtonGadget(#SendStringGadget, 10, 10, 200, 30, "Send string !")

Cordially.

Re: Read text from Webgadget

Posted: Wed May 24, 2023 6:24 pm
by bmld76
I found the problem, I test HTTPrequest locally with a URL on an another domain. When I test my app on the same serveur as the URL , it works.

Cordiall