How to capture the content of the webgaget as text automatically?

Just starting out? Need help? Post your questions and find answers here.
Allen
Enthusiast
Enthusiast
Posts: 103
Joined: Wed Nov 10, 2021 2:05 am

How to capture the content of the webgaget as text automatically?

Post by Allen »

Hi,

In below code, When the webgaget becomes stable, I need to right click inside it to raise the popup menu and choose " select all" to capture the content of the web page as text (I do not want HTML code). How can I automize the process, that is, no need to sent the select all command to the webgaget manually.

Code: Select all

MainWin=OpenWindow(#PB_Any, 0, 0, 1000, 1000, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) 
WebWin=WebGadget(#PB_Any, 10, 10, 1000, 1000, "https://www.purebasic.com/news.php") 
Repeat
  Event=WaitWindowEvent(100)
  a$=GetGadgetItemText(WebWin,#PB_Web_SelectedText )
  If a$<>""
    Debug a$
    Break
  EndIf  
Until Event = #PB_Event_CloseWindow 
CloseWindow(MainWin)
For WIn 10 x64.

Thanks

Allen