Reputation: 1030
I am trying to make a basic app using Marmalade and am currently looking into using regular expressions to retrieve a very specific piece of information from within a web page. Is there an easier way to do this? I literally want the contents of a single p tag, which annoyingly doesn't have a unique id hence my thought to use regex.
I am completely new to c++ and Marmalade, hence my asking.
Sorry if this is a stupid question but I can find anything helpful on the internet.
Upvotes: 0
Views: 307
Reputation: 2097
There are C++ functions for finding things inside strings, so it might be better to write C++ logic to find it, unless you are better at regexes. It sounds like you are not in control of the target page's content, though, so it will only work as long as the page's format remains something where your code can find the text you want.
Upvotes: 1
Reputation: 20348
Don't know about regex, but if your webservice supports GET/POST, that's what you need -
CIwHttp* m_Http = new CIwHTTP;
m_Http->SetFormData("user", user);
m_Http->SetFormData("pass", password);
//Gotheader is the callback function which will get called when header information is received from webservice
m_Http->Post(LOGIN_PATH, NULL, 0, GotHeaders, NULL);
More info in this IWHTTP example.
Upvotes: 1