I am having difficulty downloading files from web sites - a few sites work well, but most do not.
Environment:
Windows 10 Professional
Xojo Version 2017 Release 1
The results are consistent and either always work or always fail. I am currently attempting to download a membership list page so I can parse it. Strangely, I can download the site’s home page without issue, but the membership page fails to download. Since it is two pages at the same site, I thought it would be a good example to use in requesting assistance. As a test environment, I created a new project with a single Document window and put the following code in the “Open” Event Handler.
Dim aPage as String
Dim URL1 as String
Dim URL2 As String
Dim socket1 As New HTTPSocket
Dim socket2 As New HTTPSocket
URL1 = "naqcc.info"
aPage = socket1.Get( URL1, 30 )
If ( aPage <> "" ) Then
MsgBox "URL1 downloaded successfully"
Else
MsgBox "URL1 Download failed - Error Code: " + Str( socket1.LastErrorCode )
End If
break
URL2 = "naqcc.info/memberlist_complete.php"
aPage = socket1.Get( URL2, 30 )
If ( aPage <> "" ) Then
MsgBox "URL2 downloaded successfully"
Else
MsgBox "URL2 Download failed - Error Code: " + Str( socket1.LastErrorCode )
End If
break
The first download is always successful but the second always fails with Error Code 102.
Thanks in advance for any advice i get.
Ron Bower
Ellicott City, MD