Results 1 to 3 of 3

Thread: automate google searchs?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2010
    Posts
    8

    Question automate google searchs?

    Hi peeps,

    its been a while since I last did any vb (or any programming for that matter) so please be gentle.

    I want to write a simple vb.net app that has a window, in which text is pasted and then, each sentence is found and passed to Google for searching on the net.

    From the results of the search, I want to be able to filter out any site that falls within a set of pre listed sites and favour any in another list of sites for then passing out the other end, maybe as an email in a simple report with hyper links.

    Has anyone seen anything like this don before or can offer any places to start?

    Cheers,

    Steve

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,038

    Re: automate google searchs?

    I'm not entirely sure which part of that is necessarily the question. The problem of taking text and chopping it into sentences isn't quite as simple as it may seem, so that might, alone, be a problematic undertaking. If you can assume fairly simple syntax, it would likely be sufficient to break on periods, but that will only work if you assume no abbreviations were used (i.e. e.g.), and numbers would also make it not quite as easy as 3.1415.

    Beyond that you have Google. Lots of sites don't want you automating anything, and Google is a bit vague on the subject, but they do provide an API:

    https://developers.google.com/custom...pi/v1/overview

    I note that the use is free for up to 100 searches per day. An API approach is always going to be FAR superior to trying to automate a website, so this is certainly the way to go. Not only is it likely to remain relatively stable when compared to a web site, it also provides the results in a format that is pretty accessible. That API should work ok through .NET, too.
    My usual boring signature: Nothing

  3. #3
    Frenzied Member jdc20181's Avatar
    Join Date
    Oct 2015
    Location
    Indiana
    Posts
    1,168

    Re: automate google searchs?

    To search you simply, take the Search Query URL of Google, and combine it with your text keywords, and navigate.

    Code:
    Webbrowser1.navigate(https://www.google.com/search?source=hp&q= & Textbox1.text)
    In your case you would also loop through each string to get what you are wanting, and maybe even fill a listbox or something with the results. Etc.

    You can also use API's but I know nothing of those - in this context/situation.
    Disclaimer: When code is given for example - it is merely a example.




    Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width