interact with webpages?

Hi! i want to make a program that opens a webpage, enter google and begin a search for anything the user puts in to the console and then enter a specified link from the search results. i have no idea how to do this and i need to get pointed in the right direction since i dont even know what keywords to use to get information about this. thx a lot !
i already answered similar question in the past:
http://www.cplusplus.com/forum/beginner/102768/
Your question is a little bit vague. When you say "enter a specific link from the search results", what do you mean?

Are you talking about a console app which asks the user for a query which it then forwards to Google. Then, when it's obtained the results, it process them and offers a list of links to the user. The user then selects one of the links and your app navigates the browser to that page?

If so, the post tath provided a link to only provides a partial answer. A full solution would require you to use browser automation, which is far from trivial (i.e. not really a question for the beginners' forum.) I've only ever done this with Internet Explorer on Windows, which is probably the easiest (if you already know COM.) Automating Firefox, Chromes, etc. is something I've only read about (on Windows, Linux, ...)

When it comes to obtaining search results, I would prob. not use the socket API to send an HTTP request. Instead I'd use an HTTP library, like cURL or (if you're on Windows) WinINet, with a search URL I've constructed on the fly, to obtain the required results.

Andy
Last edited on
Topic archived. No new replies allowed.