0

Hi, I'm a beginner in C++ and I need some help how to get a website's source code and save it into a string.

Oh, and also: how can I then search the source for a specific keyword AND how can I "extract" a word between 2 keywords ? Here's what I mean:

$source = _INetGetSource("http://www.google.com") ; get websites source
$stringBetween = _StringBetween($source,"a keyword","second keyword") ; this extracts a word between those two keywords

If StringInStr($source, "Google") Then ; this searches the source for a keyword Google
; do something
EndIf

This code is in autoit and I hope it'll help you understand what I need help with.

6
Contributors
8
Replies
9
Views
8 Years
Discussion Span
Last Post by ArkM
0

no, I gave the autoit code as an example of what I mean.
I want to know how to do the same thing but in C++

0

I don't know about one line, but it only takes a few lines with Wininet in Win32. And I'm sure you'll need more than one string to store a whole page in.

0

... And I'm sure you'll need more than one string to store a whole page in.

What's a problem? For example, in VC++ source.max_size() for std::string source is equal to 4294967294 bytes ;)

0

What's a problem? For example, in VC++ source.max_size() for std::string source is equal to 4294967294 bytes ;)

I've downloaded files larger than 4GB(till the game got a smart installer). Although I doubt he'll ever retrive something that LARGE. lol

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.