Page 1 of 1
Posted: Fri Mar 21, 2003 2:34 pm
by BackupUser
Restored from previous forum. Originally posted by FonkFonk.
Hello !
I'm desperately trying to have my code make a copy/paste from a Web gadget.
Using the webbrowser.pb example, I'm trying this in case 5:
Case 5
SetGadgetText(10, GetGadgetText(4))
Tt$ = GetGadgetText(10)
SetClipboardText(GetGadgetText(10))
But the clipboard won't get anything ...
Has someone a tip or an idea ?
Thanks in advance.
Pierre
Posted: Fri Mar 21, 2003 7:26 pm
by BackupUser
Restored from previous forum. Originally posted by ricardo.
Did you want to paste the URL or the source code of the HMTL page?
The GetGadgetText will only give you the URL.
If you want the content of the page, then get the url, and use the network command to get the content of the page... a lot of examples in this forum can show you how to do that.
I dont build an example for you because my PC die yesterday!!
In this other i dont have PureBasic installed.
ATM its not possible to have access to other methods/events of the WebGadget directly from PB (maybe using some APIs but its complicated since the WebGadget needs COM calls).
Best Regards
Ricardo
Dont cry for me Argentina...
Posted: Fri Mar 21, 2003 7:33 pm
by BackupUser
Restored from previous forum. Originally posted by FonkFonk.
Originally posted by ricardo
Did you want to paste the URL or the source code of the HMTL page?
The GetGadgetText will only give you the URL.
If you want the content of the page, then get the url, and use the network command to get the content of the page... a lot of examples in this forum can show you how to do that.
I dont build an example for you because my PC die yesterday!!
In this other i dont have PureBasic installed.
ATM its not possible to have access to other methods/events of the WebGadget directly from PB (maybe using some APIs but its complicated since the WebGadget needs COM calls).
Best Regards
Ricardo
Dont cry for me Argentina...
Thanks for you answer.
Well, I need to get everything that appears in a webgadget (not the source code) as I would in Internet Explorer with a CTRL + A, and a CTRL + c command, to paste it in notepad, for example.
The purpose is to create a file that would contain only datas : Lets say that the internet page would display a table with numbers, I would need to get those numbers.
Pierre
Posted: Fri Mar 21, 2003 8:43 pm
by BackupUser
Restored from previous forum. Originally posted by ricardo.
Maybe the easier way is getting the url by gegadgettext command and then download it.
You will get the complete source, something like:
... etc
Then you need to parse it, its easy.
However, using the IExplorer as an Activex in VB is almost the same since you need to save the html page and then parse it.
Best Regards
Ricardo
Dont cry for me Argentina...
Posted: Fri Mar 21, 2003 9:05 pm
by BackupUser
Restored from previous forum. Originally posted by FonkFonk.
Originally posted by ricardo
Maybe the easier way is getting the url by gegadgettext command and then download it.
You will get the complete source, something like:
... etc
Then you need to parse it, its easy.
However, using the IExplorer as an Activex in VB is almost the same since you need to save the html page and then parse it.
Best Regards
Ricardo
Dont cry for me Argentina...
Well, my problem is I need to get the contents of a page created dynamically (with PHP, ASP, ...) ...
Pierre
Posted: Fri Mar 21, 2003 10:48 pm
by BackupUser
Restored from previous forum. Originally posted by ricardo.
Well, my problem is I need to get the contents of a page created dynamically (with PHP, ASP, ...) ...
Its the same thing... PHP, ASP... creates pages that has no differences with normal html pages. PHP & ASP are not different formats of web pages, are programming languages that create dinamically html or text pages.
You can create dinamicall web pages using PureBasic with
WriteStringN("")
WriteStringN("this is my web page")... etc
A good example could be a web server developed in PueBasic that creates dinamicall content... its no to hard to code it.
Best Regards
Ricardo
Dont cry for me Argentina...
Posted: Sat Mar 22, 2003 7:01 pm
by BackupUser
Restored from previous forum. Originally posted by FonkFonk.
Thanks Ricardo for your help.
Actually, after searching on Internet, I found what I needed: It's a free DLL that performs the exact "sendkeys" equivalent I needed (
http://www.hiddensoft.com/AutoIt/).
I modified part of the "webbrowser.pb", as follows :
Code: Select all
Case 5
w$="PureBasic MiniBrowser v1.0" ; Specifies target window name.
window$=""
;Purpose :
;
;We want to perform a copy/paste from a webgadget.
;In order to do that, we usually manually right-click on a page,
;click on "Select all",right click again, "Copy".
;In this example, I use the french shortcuts ("s" for "Select All","e" for "Copy").
;We load the library in memory :"
If OpenLibrary(0, "AutoItDLL.dll")
;We specify the window (based on its title) we want to
;focus on :
W=IsFunction(0,"AUTOIT_WinActivate")
CallFunctionFast(W,"PureBasic MiniBrowser v1.0",window$)
;We declare the right click function :
F = IsFunction(0, "AUTOIT_RightClick")
;We randomly move the mouse cursor at x=300 and y=300 :
CallFunctionFast(F,300,300)
send1=IsFunction(0, "AUTOIT_Send")
;Now for the shortcuts, with an another right-click:
CallFunctionFast(send1,"s")
CallFunctionFast(F,300,300)
CallFunctionFast(send1,"e")
;We cancel the selection :
leftclick=IsFunction(0, "AUTOIT_LeftClick")
CallFunctionFast(leftclick,300,300)
;And we unload the library from memory:
CloseLibrary(0)
Please note that :
- To control the way this code works, I set the webbrowser size to 800x600;
- It moves the mouse cursor at 300x300, where there might be 3 differents items (image, link, other) depending on the internet page you load ... So, the context popup menu might differ and the code wouldn't do what you'd expect it to do ...
Hope it can be of some use for someone.
Pierre