I am trying to write a small screen scrapper program to get data from an https url.
Is there an https package? Googling didn't find anything.
Thanks in advance.
Donald [|]
Hi Donald - a couple of options:
| request |
request := IWinHttpRequest new.
request open: 'GET' url: 'https://github.com/dolphinsmalltalk' async: false. request send.
request responseText
"or"
File readAllText: (URLMonLibrary default urlDownloadToCacheFile: 'https://github.com/dolphinsmalltalk')
HTH.
John
On Thursday, October 1, 2020 at 12:23:38 AM UTC+1, dmm...@gmail.com wrote:
I am trying to write a small screen scrapper program to get data from an https url.
Is there an https package? Googling didn't find anything.
Thanks in advance.
Donald [|]
On Thursday, October 1, 2020 at 3:43:55 AM UTC-4, john.a...@gmail.com wrote:
Hi Donald - a couple of options:
| request |
request := IWinHttpRequest new.
request open: 'GET' url: 'https://github.com/dolphinsmalltalk' async: false.
request send.
request responseText
"or"
File readAllText: (URLMonLibrary default urlDownloadToCacheFile: 'https://github.com/dolphinsmalltalk')
HTH.
John
On Thursday, October 1, 2020 at 12:23:38 AM UTC+1, dmm...@gmail.com wrote:
I am trying to write a small screen scrapper program to get data from an https url.
Is there an https package? Googling didn't find anything.
Thanks in advance.
Hi John,Donald [|]
Inspecting the first code snippet returns nil.
The second says "File dnu readAllText:
Perhaps I am missing a package? I am using D6 Pro.
Thanks for the reply.
Donald [|]
Hi Donald - I'm using Dolphin 7.1. You can enable the examples in D6.1 (I don't currently have access to D6) as follows:
For the first example I get an undeclared error for IWinHttpRequest. You can generate this class with the ActiveX Component Wizard:
1) Browse; select 'Microsoft WinHTTP Services'; click OK
2) Next; uncheck the Class Prefix check box; Next
3) Generate; Finish
The first example should now work.
The second example will work modified as follows:
| stream |
stream := FileStream read: (URLMonLibrary default urlDownloadToCacheFile: 'https://github.com/dolphinsmalltalk').
[stream upToEnd] ensure: [stream close]
Note this is all on Windows 10; I don't know if the examples will work on earlier Windows versions (maybe this is why you're still using D6?).
Cheers.
John
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 72:20:03 |
Calls: | 6,489 |
Calls today: | 2 |
Files: | 12,096 |
Messages: | 5,275,731 |