Webgadget Problem
Webgadget Problem
Hello,
I want to program an automated download and have the following problem, when I call this page with the WebGadget, log in and then call the download link with SetgadgetText() I get the error “unauthorized”.
I think it has something to do with the cookies, but I don't see any point to influence it.
Does anyone have an idea how to automate these steps?
PS: if I log in to FireFox or Explorer and then enter the download link in the address bar, the download works.
I want to program an automated download and have the following problem, when I call this page with the WebGadget, log in and then call the download link with SetgadgetText() I get the error “unauthorized”.
I think it has something to do with the cookies, but I don't see any point to influence it.
Does anyone have an idea how to automate these steps?
PS: if I log in to FireFox or Explorer and then enter the download link in the address bar, the download works.
macOS Catalina 10.15.7
Re: Webgadget Problem
Hi Wolfram,
I may I have a couple options, depending on how you answer the following questions:
1. What OS / PB version? You mention Explorer but the "signature" area of your profile states macOS Catalina.
2. Is a WebGadget (visual) mandatory? Sill not a problem, but there might be a path using a headless browser.
3. Are you able to share the URL, temporary credentials, anything that can help with testing?
4. Is this for personal use or will it be distributed? May narrow down your options if distributed.
I may I have a couple options, depending on how you answer the following questions:
1. What OS / PB version? You mention Explorer but the "signature" area of your profile states macOS Catalina.
2. Is a WebGadget (visual) mandatory? Sill not a problem, but there might be a path using a headless browser.
3. Are you able to share the URL, temporary credentials, anything that can help with testing?
4. Is this for personal use or will it be distributed? May narrow down your options if distributed.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Webgadget Problem
Hello JHPJHP,
this is latest project under Windows 11and PB 6.10.
2. A WebGadget is not mandatory. Wget works for this job, but I want to have a GUI. I guess it is a problem of the cookies or the session which seems to change if I do it this way.
3. The URL is a local Device.
4. No, it will not distributed.
this is latest project under Windows 11and PB 6.10.
2. A WebGadget is not mandatory. Wget works for this job, but I want to have a GUI. I guess it is a problem of the cookies or the session which seems to change if I do it this way.
3. The URL is a local Device.
4. No, it will not distributed.
macOS Catalina 10.15.7
Re: Webgadget Problem
Hi Wolfram,
I just sent you a PM containing a link to a full version download of my Chromium Framework.
➤ \PureBasic WebGadget\CrWG Templates\2_Navigate_Website.pb.
1. Execute the code.
2. Navigate to the URL.
3. Manually login.
4. Navigate to the download URL.
Question: If you Navigate directly to the download URL does server authentication pop up?
If the first example worked, try the next example:
➤ \PureBasic WebGadget\CrWG Examples\Authenticate_Proxy.pb.
• Should work with most server-based authentication, but I'm unsure this is what you're using.
1. Script: #Cr_WebGadget_Enable_Proxy_Server.
• Either change the IP address and port number to match your server or REM the line.
2. Execute the code.
3. Navigate to the URL after entering the username and password.
• If supported it will auto-authenticate.
• If not support there are numerous other options.
4. Navigate to the download URL.
I just sent you a PM containing a link to a full version download of my Chromium Framework.
Try the following example:Wolfram wrote:The URL is a local Device.
➤ \PureBasic WebGadget\CrWG Templates\2_Navigate_Website.pb.
1. Execute the code.
2. Navigate to the URL.
3. Manually login.
4. Navigate to the download URL.
Question: If you Navigate directly to the download URL does server authentication pop up?
If the first example worked, try the next example:
➤ \PureBasic WebGadget\CrWG Examples\Authenticate_Proxy.pb.
• Should work with most server-based authentication, but I'm unsure this is what you're using.
1. Script: #Cr_WebGadget_Enable_Proxy_Server.
• Either change the IP address and port number to match your server or REM the line.
2. Execute the code.
3. Navigate to the URL after entering the username and password.
• If supported it will auto-authenticate.
• If not support there are numerous other options.
4. Navigate to the download URL.
Last edited by JHPJHP on Tue Oct 29, 2024 4:53 pm, edited 1 time in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Webgadget Problem
Hello JHPJHP,
sounds good and I will try it.
Unfortunately the PM is on hold and I can't read it at the moment.
sounds good and I will try it.
Unfortunately the PM is on hold and I can't read it at the moment.
macOS Catalina 10.15.7
Re: Webgadget Problem
Hi Wolfram,
I moved our PM to Coding Questions so that others using the Framework can benefit.
• Download the latest version of the Framework, use the link from our previous PM.
• See the example: \PureBasic WebGadget\CrWG Examples\Download_Progress.pb.
Instructions:
1. Press the Navigate button.
2. Select a download link from the PureBasic website.
• The download will save to the Desktop; user-defined location.
• The download will display a filename, progress bar status and status text.
3. Select the Checkbox to disable downloading.
There are literally thousands of accessible events without having to code anything.
• Most of these events are turned off until a Domin is enabled.
• Enabling a domain is as easy as it sounds: Page_Enable(Connection, EventID).
See the following template, it demonstrates how to enable the built-in debugger.
• \PureBasic WebGadget\CrWG Templates\3_Debug_Events.pb
Read my PDF help files for a better understanding of the Framework.
• \PureBasic WebGadget\Shared Files\references\
In addition, visit the Chrome DevTools Protocol website, it's an invaluable resource.
I moved our PM to Coding Questions so that others using the Framework can benefit.
It was easier for me to create you an example then fumble through the directions.Wolfram wrote:Do you know is there any way to have a callback for download is finished?
Can I define my own download folder?
• Download the latest version of the Framework, use the link from our previous PM.
• See the example: \PureBasic WebGadget\CrWG Examples\Download_Progress.pb.
Instructions:
1. Press the Navigate button.
2. Select a download link from the PureBasic website.
• The download will save to the Desktop; user-defined location.
• The download will display a filename, progress bar status and status text.
3. Select the Checkbox to disable downloading.
There are literally thousands of accessible events without having to code anything.
• Most of these events are turned off until a Domin is enabled.
• Enabling a domain is as easy as it sounds: Page_Enable(Connection, EventID).
See the following template, it demonstrates how to enable the built-in debugger.
• \PureBasic WebGadget\CrWG Templates\3_Debug_Events.pb
Read my PDF help files for a better understanding of the Framework.
• \PureBasic WebGadget\Shared Files\references\
In addition, visit the Chrome DevTools Protocol website, it's an invaluable resource.
Last edited by JHPJHP on Fri Nov 01, 2024 5:34 am, edited 1 time in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Webgadget Problem
Unfortunately the file "\PureBasic WebGadget\CrWG Examples\Download_Progress.pb" is missing.
macOS Catalina 10.15.7
Re: Webgadget Problem
Hi Wolfram,
I just sent you another PM with a link to the Chromium Framework.

I just sent you another PM with a link to the Chromium Framework.

If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Webgadget Problem
Thank you very much JHPJHP.
Your work has helped me a lot. The framework offers a lot of possibilities.
At the moment I am still looking for a solution to send a postrequest.
Your work has helped me a lot. The framework offers a lot of possibilities.
At the moment I am still looking for a solution to send a postrequest.
macOS Catalina 10.15.7
Re: Webgadget Problem
Hi Wolfram,
That's great to hear.
Sending a POST Request can also be done from my Chromium Framework, through DevTools Protocol using the Fetch Domain.
See the following examples, both using the Fetch Method for very different purposes.
• \PureBasic WebGadget\CrWG Example\Allow_Block_Website.pb
• \PureBasic WebGadget\CrWG Example\Authenticate_Proxy.pb
Let me know if you require additional information or help with some code.
That's great to hear.
Sending a POST Request can also be done from my Chromium Framework, through DevTools Protocol using the Fetch Domain.
See the following examples, both using the Fetch Method for very different purposes.
• \PureBasic WebGadget\CrWG Example\Allow_Block_Website.pb
• \PureBasic WebGadget\CrWG Example\Authenticate_Proxy.pb
Let me know if you require additional information or help with some code.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Webgadget Problem
Hello JHPJHP,
I tried the Authenticate_Proxy.pb example to log in to this forum, but it doesn't work.
I am trying this without a proxy as I don't have one.
I tried the Authenticate_Proxy.pb example to log in to this forum, but it doesn't work.
I am trying this without a proxy as I don't have one.
macOS Catalina 10.15.7
-
Randy Walker
- Addict

- Posts: 1109
- Joined: Sun Jul 25, 2004 4:21 pm
- Location: USoA
Re: Webgadget Problem
Hi Wolfram,JHPJHP wrote: Sat Oct 19, 2024 4:53 pm Hi Wolfram,
I just sent you a PM containing a link to a full version download of my Chromium Framework.
Send that guy a cup of coffee.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Randy
I *never* claimed to be a programmer.
Re: Webgadget Problem
Hi Randy Walker,
Thank you. As per our arrangement, I'll have your weekly cut dropped at the usual spot
-------------------------------
Hi Wolfram,
I just sent you a PM containing a link to an updated version of my Chromium Framework.
Three examples have been added:
• \PureBasic WebGadget\CrWG Example\Authenticate_Basic_1.pb
• \PureBasic WebGadget\CrWG Example\Authenticate_Basic_2.pb
• \PureBasic WebGadget\CrWG Example\Authenticate_Form.pb
Authenticate_Basic_1.pb and Authenticate_Basic_2.pb
➤ Two different methods to automate (basic) server authentication.
• Authenticate_Basic_1.pb uses the Fetch Domain.
• Authenticate_Basic_2.pb uses the Network Domain.
Authenticate_Form.pb
• Simple JavaScript method to provide credentials and submit a form.
• Current configuration is setup to login to the PureBasic forum.
With the example Authenticate_Form.pb the timer could be replaced by a delay, and under most circumstances isn't needed. phpBB is known for monitoring things that happen too fast, trying to prevent BOTS and automation scripts like this from posting.
Thank you. As per our arrangement, I'll have your weekly cut dropped at the usual spot
-------------------------------
Hi Wolfram,
I just sent you a PM containing a link to an updated version of my Chromium Framework.
Three examples have been added:
• \PureBasic WebGadget\CrWG Example\Authenticate_Basic_1.pb
• \PureBasic WebGadget\CrWG Example\Authenticate_Basic_2.pb
• \PureBasic WebGadget\CrWG Example\Authenticate_Form.pb
Authenticate_Basic_1.pb and Authenticate_Basic_2.pb
➤ Two different methods to automate (basic) server authentication.
• Authenticate_Basic_1.pb uses the Fetch Domain.
• Authenticate_Basic_2.pb uses the Network Domain.
Authenticate_Form.pb
• Simple JavaScript method to provide credentials and submit a form.
• Current configuration is setup to login to the PureBasic forum.
With the example Authenticate_Form.pb the timer could be replaced by a delay, and under most circumstances isn't needed. phpBB is known for monitoring things that happen too fast, trying to prevent BOTS and automation scripts like this from posting.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
-
Randy Walker
- Addict

- Posts: 1109
- Joined: Sun Jul 25, 2004 4:21 pm
- Location: USoA
Re: Webgadget Problem
Hi Wolfram,JHPJHP wrote: Sun Nov 10, 2024 7:18 pm Hi Wolfram,
I just sent you a PM containing a link to an updated version of my Chromium Framework.
Wow! Seriously. You need to send that guy a cup of coffee or two.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Randy
I *never* claimed to be a programmer.
