Problem Reading Webpage
Posted: Wed Apr 25, 2012 2:52 pm
This webpage https://www.transit-transit.com/pagina/hub.htm is quite lengthy (10858 bytes) but when read with PureBasic's ReceiveHTTPFile() command the result is only 230 bytes.
The HTML read by ReceiveHTTPFile() appears to be a request to redirect (error 302), but to identically the same webpage.
So how can I properly read the HTML in this webpage?
The code I am using is:
The HTML read by ReceiveHTTPFile() appears to be a request to redirect (error 302), but to identically the same webpage.
So how can I properly read the HTML in this webpage?
The code I am using is:
Code: Select all
; Problem Reading Webpage
#file = 0
Define url$ = "https://www.transit-transit.com/pagina/hub.htm"
Define file$ = "C:\html.txt"
Define header$, html$, p
InitNetwork()
; Get HTTP header
header$ = GetHTTPHeader(url$)
Debug "Header = " + ReplaceString(header$, Chr(10), "¬")
Debug ""
; Get HTML code
ReceiveHTTPFile(url$, file$)
Debug "Filesize = "+Str(FileSize(file$))+" bytes" ; Web page size is 10858 bytes
Debug ""
ReadFile(#file, file$)
While Not Eof(#file)
Debug ReadString(#file)
Wend
End