Hello Everyone,
Has anyone used FWH to create an application to "scrape" (retrieve) data from a website by providing a string parameter? If so, could you provide sample code?
Thank you,
Retrieve Website Data
Re: Retrieve Website Data
Here some code from examples of harbour:
Hope this help,
Code: Select all
proc main()
local socket, buffer
socket := hb_inetCreate()
socket := hb_inetConnect( "www.fortify.net", 80, socket )
? "INETCONN", socket
? "INETTIMEOUT", hb_inetTimeout( socket, 500 )
? "INETERR", hb_inetErrorCode( socket )
? "INETFD", hb_inetFD( socket )
? "INETSEND", hb_inetSend( socket, "GET / http/1.1" + hb_inetCRLF() + "Host: " + "www.syenar.hu" + hb_inetCRLF() + hb_inetCRLF() )
? "INETERR", hb_inetErrorCode( socket )
buffer := Space( 1024 )
? "INETRECVALL", hb_inetRecvAll( socket, @buffer, Len( buffer ) )
? "BUFFER", ">" + AllTrim( buffer ) + "<"
? "INETCLOSE", hb_inetClose( socket )
return
Last edited by AntoninoP on Wed Aug 05, 2015 8:46 am, edited 1 time in total.
Re: Retrieve Website Data
Thank you Mr. AntoninoP
For https sam code will work or any other method
For https sam code will work or any other method
Regards, Greetings
Try FWH. You will enjoy it's simplicity and power.!
Try FWH. You will enjoy it's simplicity and power.!
Re: Retrieve Website Data
The code is taken from harbour\contrib\hbssl\tests\test.prg, the same example show how to use ssl for a secure connection.
But I don't tried it, it is necessary download OpenSSL and build hbssl.
Regards,
But I don't tried it, it is necessary download OpenSSL and build hbssl.
Regards,