Extracting links form html source.
Dear All,
I''m trying to figure out how to write a function that will return the html links from a string containing html code. I''m not sure which C string functions to use. My first thought was to use strtok, but that doesn''t seem to work. Does anyone have any suggestions on how to go about this?
Thanks,
Jesse
C: strstr
C++: std::string::find
Perl/Python: REs (much faster, and standard with the language)
One thing to give thought to is to grab the HTML file, prepend some j''script to it in just the right place and use that script to dump the links (which should be nicely stored in an array whose name I forget).
C++: std::string::find
Perl/Python: REs (much faster, and standard with the language)
One thing to give thought to is to grab the HTML file, prepend some j''script to it in just the right place and use that script to dump the links (which should be nicely stored in an array whose name I forget).
Yes, extracting HTML links from source files is not difficult using pure C/C++. As the other member has mentioned, one solution is to store the source file in a string object and analyze each section accordingly.
Kuphryn
Kuphryn
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement