Discussion:
Recommeded way to read a web page?
Fulvio Senore
2014-09-30 06:52:30 UTC
Permalink
I need to read a small dynamic web page into a wxString for further
processing by the program.

Is there a recommended way to do this with wxWidgets? If possible I'd
rather not use a custom library to reduce dependencies.

Thanks in advance.

Fulvio Senore
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Bryan Petty
2014-09-30 06:57:08 UTC
Permalink
Post by Fulvio Senore
I need to read a small dynamic web page into a wxString for further
processing by the program.
Is there a recommended way to do this with wxWidgets? If possible I'd rather
not use a custom library to reduce dependencies.
Depends on what you're reading, and what you need to parse out of it.

If it's just HTTP, then wxHTTP is good enough for fetching a page, but
if you need HTTPS support, look into wxCurl.

As for parsing, what are you grabbing? HTML, JSON, XML, or something else?

If it's XML, you have all you need in wxWidgets already for parsing
it. Anything else and you're mostly on your own. wxRegEx could handle
simple cases, but won't get you far for more advanced use.
--
Regards,
Bryan Petty
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Fulvio Senore
2014-09-30 19:36:00 UTC
Permalink
Post by Bryan Petty
Post by Fulvio Senore
I need to read a small dynamic web page into a wxString for further
processing by the program.
Is there a recommended way to do this with wxWidgets? If possible I'd rather
not use a custom library to reduce dependencies.
Depends on what you're reading, and what you need to parse out of it.
If it's just HTTP, then wxHTTP is good enough for fetching a page, but
if you need HTTPS support, look into wxCurl.
As for parsing, what are you grabbing? HTML, JSON, XML, or something else?
If it's XML, you have all you need in wxWidgets already for parsing
it. Anything else and you're mostly on your own. wxRegEx could handle
simple cases, but won't get you far for more advanced use.
Thank you for your suggestions. I am using plain HTTP and I simply need
to read a few chars from an url with a query string (something like
www.aaaa.it/page.asp?param=12).

The program will read a very simple HTML page, just to get some encoded
information. I simply need to get an activation code based on a serial
number.

Fulvio
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...