How to interact with google search engine using java HTTP POST

I am trying to develop an desktop app that acts as an online radio tuner. I want to use google as an index site for actually searching for radio stations online. So I was wandering if it is possible for me to use java to actually interface with the google search engine servers. For example, I have built a gui that allows you to enter search text. This gui will connect to the web. I would like it to connect to the Google site and post the query to the google web servers. Then i would like to began to parse the response( html page) that i get back from the google servers. Like using google without actually typing in the text field on the google site. Can anyone tell me if it is possible to do this with java. If so, what would be the best way to go about doing this. Thanks.

Thanks for the response. It was actually alot easier to do than I anticipated. All I had to do was create a URL object initialized with the google url(search text embedded in the url - http://www.google.com/search?q=" + searchText + "&hl=en&ie=UTF-8&oe=UTF8).
Looks like this:
String google = http://www.google.com/search?q=" + searchText + "&hl=en&ie=UTF-8&oe=UTF8;
URL url = new URL(google);  // creating Google Url object
URLConnection connection = url.openConnection();
       connection.setDoOutput(true);
       connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" );  // fooling google servers into thinking the request is coming from a real browser
       BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));The content returned by the google server can be accessed calling the BufferedReader class methods.

Similar Messages

  • How do you change the search engine used in the address bar?

    I use the address bar to search, instead of the actual search bar field. Why? It's easier. Or, it used to be. It used to use Google. Now it's using Yahoo!. This is unacceptable. Haha. How do I change which search engine is used in the ADDRESS bar?

    had this problem after accidentally downloaded the yahoo toolbar along with an adobe product. Firstly, tried to remove it control panel in add/remove programmes but it refused to uninstal. Since then was told by technicians of my ip to use Revo uninstaller the free ed. Next step was go to tools then options. On the general tab, at the bottom you will find manage-add-ons. under search provider do not want. f yahoo is still there disable it.
    Also go to internet options in control panel and set up there too. Be sure to find and tick the option that other search engines cannot change yours. Be sure to set the appropriate home page.

  • How do I reinstall Google Search Engine

    I accidentally removed Google Search Engine from the "manage search engines" dialog, how do I bring it back?

    You can restore the default Search Engines through the Firefox SafeMode. <br />
    http://support.mozilla.com/en-US/kb/Safe+Mode

  • I opened my lap top clicked on firefox TO START BROWSING and MSN OPENS AND IS NOW MY BROWSER PAGE HAVE TRIED EVERYTHING I KNOW HOW DO I GET BACK TO FIREFOX WITH GOOGLE SEARCH ENGINE, THANKS HELP!!!!!

    i turned on my computer, clicked the firefox icon, which opens to MSN PAGE, don't know how it changed from firefoE to MSN, how do I get back to Firefox page I reset everything I thought might work, tried restore no luck what can I do thanks dave

    i turned on my computer, clicked the firefox icon, which opens to MSN PAGE, don't know how it changed from firefoE to MSN, how do I get back to Firefox page I reset everything I thought might work, tried restore no luck what can I do thanks dave

  • How do I change the search engine in Safari?

    Hi y'all,
    How do I change the search engine used in the "search" slot in the menu bar? I still want it to use google, but would like to change it to the danish version.
    Kind regards
    -z

    Hi
    Easiest way to change the search is to install 3rd party freeware Inquisitor. After installing it, restart Safari. Go to Safari Preferences. Click on the arrow at the far end of the menu panel. You'll see an hour-glass icon. Click on it to open the Inquisitor panel. Click on the search engine drop-down menu and select your preferred search engine.

  • How can I change the default Google search engine in Firefox 8 from google.fr to google.co.uk? Yes, I live in France with a French ISP, but English is my mother tongue and I want UK based responses.

    How can I change the default Google search engine in Firefox 8 from google.fr to google.co.uk? Yes, I live in France with a French ISP, but English is my mother tongue and I want UK based responses.
    I'm using XP Pro.

    You can find search engines on the Mycroft Project website.
    * http://mycroft.mozdev.org/
    * http://mycroft.mozdev.org/google-search-plugins.html

  • Untrusted connection Error when using google search field in top line. Ok with other search engines

    When opening www.google.dk and searching from the page, everything is ok
    When using Google search engine in the address line search bar the error is present
    When changing to Yahoo, bing or another search engine in the search bar, the error is not present
    So, the error
    "www.google.com uses an invalid security certificate.
    The certificate is not trusted because no issuer chain was provided.
    (Error code: sec_error_unknown_issuer)"
    is only present when using google search engine in the search bar
    Have tried to delete the files cert8.db and key3.db with no success
    Read about firewall settings, but Bullguard firewall was not covered

    In your "More system details" it says your address bar search provider is Babylon, not Google. Perhaps that's the problem? Or are you using a shortcut to force the address bar search to Google?
    This add-on will reset your address bar search to Google: https://addons.mozilla.org/firefox/addon/searchreset/
    That might not stick if you have an add-on which reverts the setting. You can disable nonessential and unrecognized extensions here:
    orange Firefox button (or Tools menu) > Add-ons > Extensions category
    Also, you might need to edit or delete your user.js file to prevent your settings from being overridden at the next startup. This article has info on that: [[How to fix preferences that won't save]].
    Any luck?

  • Just got snookered into replacing google search engine with yahoo. how do i restore?

    I got snookered into downloading the yahoo search engine as my default. How do I restore my prior configuration and get back to the google search engine as default?

    Open Firefox Preferences:
    Ciao.

  • WHY CAN I NOT EDIT THE DEFAULT SEARCH ENGINE USED BY THE ADDRESS BAR (NOT THE SEARCH BAR NEXT TO IT) FROM BING TO GOOGLE?

    I am asking this question again, because upon checking the forum for a solution I was shocked and appalled by the severe lack of grammar, punctuation and spelling I encountered while reading answers to this question. Obviously several people where to busy to actually read the question being asked and simply answered with instructions on how to change the default search engine for the search bar. SO, here I am asking the same question, why? because it still has not been answered and I myself still CANNOT find this setting anywhere. I use multiple browsers for different tasks, Chrome is KICKING the .... out of you guys Mozilla, why did you ever let your self get taken in by Micro-crack (Microsoft), if I recall correctly the inception of this program was partly motivated by the need for an alternative to the idiosyncrasies and vulnerability of Microsoft Internet Explore. This really feels like a HUGE step backwards, I would love to see a return to the days when Mozilla Firefox was and inspiration to developers and techs everywhere. And please will someone just answer the right question this time. Trust me when I say it will be obvious who does and does not read this in it's entirety.
    ''Edited by a moderator due to language. See the [http://support.mozilla.com/kb/Forum+and+chat+rules+and+guidelines Rules & Guidelines] .''

    HAHA! I have solved it! Ok here is the URL for Google, as mentioned above by bram:
    "Go to About:config
    Search for keyword.URL
    Double click the Value entry field, and change it to the search engine you prefer"
    Enter this URL for the string value
    http://www.google.com/#hl=en&output=search&sclient=psy-ab&q=

  • How to change the default search engine? I accidentaly change it from google to yahoo, and I can't get it back. I changed my homepage too, but it isn't solved. Thanks

    dear, there.
    how to change the default search engine? I accidentaly change it from google to yahoo, and I can't get it back. I changed my homepage to google too, but it isn't solved. Thanks

    Clarification:
    I believe now you potentially lose all extensions, plug-ins when you use the new reset function, but you will let me know.
    If that is the case, your find corrupt file method maybe better. However, I reviewed the two help articles and there appear to be more files than just the delete search.json file and a possible search.sqlite file in the Firefox Profile Folder. I am confused. Then I have to find the folders. I think help articles mentioned how to find the profile containing the files, but not sure.

  • Am using Firefox 5.0.1, any new tabs open with a search engine for imvu and when I go to about:config there is no entry for browser.newtab.url that I can modify

    I am using Firefox 5.0.1.4205 with Windows 7 Home Premium Service pack1. My new tabs in Firefox open with a search engine for imvu rather than google as I would prefer. I can't find an answer to my problem so far because when I try the recommended use of about:config and finding browser.newtab.url; it is not listed. Is this version of firefox to old to have that, or is it just missing? What can I do to get my new tabs to open with a Google search engine. This is on my 80 year old father's computer so he is not likely to upgrade browsers as I would on my home computer. Thank you for any help with this.

    The new tab page (about:newtab) wasn't introduced until a later version of Firefox (iirc, ''Firefox 10'') , which is why that pref can't be found.
    Sounds like your father picked up some Malware.
    Maybe this is what you're dealing with.
    http://www.shouldiremoveit.com/IMVU-Inc-Toolbar-34367-program.aspx
    Also, I see a number of Plugins listed to bee concerned about.
    Toolbar Plugin
    MindSpark Toolbar Platform Plugin Stub for 32-bit Windows
    WildTangent Games App V2 Presence Detector

  • Sometimes when using the Google search engine, after using the Back button in the Firefox 4.0.1 browser, I am no longer able to click in the Google search box.

    Sometimes when using the Google search engine, after using the Back button in the Firefox 4.0.1 browser, I am no longer able to click in the Google search box.
    This problems has been occurring on two different machines over the last two days.

    I think this may not be a browser problem but rather a Google problem.
    I am getting the same problem with the Google Chrome browser.

  • I keep getting the Firefox start page with Google search. How do I get my homepage back?

    When I click the Mozilla Firefox icon, instead of my homepage I get a starter page with Google search. How can I get rid of the starter page and get my homepage back?
    == This happened ==
    Every time Firefox opened
    == Started about a week and a half ago.

    Hello Linda.
    I fear your problem may be deeper than your homepage gone missing, but you can change your homepage easily by going into Tools > Options > General and entering the address you want in the "Home Page" field.
    I should warn you, however, that the version of Firefox you are using at the moment is outdated and is no longer supported. Please install the latest version for maximum speed, security and functionality. It's completely free, as always. You can get it through Firefox update service (Help > Check for updates...) or at www.getfirefox.com

  • I have an issue with my google search engine in Firefox whereby all results are in Polish. What can I do to fix?

    Doesn't do it with other search engines
    Have tried to fix but no success

    You can use http://www.google.com/ncr to prevent Google from redirecting you to a local Google website.
    You can set Google preferences on the Google Search settings page (click the gear icon at the top right).
    * http://www.google.com/preferences?hl=en
    Such settings are stored in a (PREF) cookie on your computer that you need to allow.
    * Tools > Options > Privacy > Cookies: "Exceptions"
    * Tools > Page Info > Permissions

  • After resetting firefox as it crashed unless on safe mode can't use google search engine

    I had to reset Firefox after it crashed unless in safe mode I tried the disable hardware acceleration still crashed so reset. Lost all my bookmarks and history etc and my google search bar no longer works in fact my search bar doesn't work whichever search engine I try and I can't sync either as I have an unknown error

    After a reset, you should find an Old Firefox Data folder on your desktop. If you can find that, you may be able to recover your bookmarks and other data from it. Is it there?
    On your question about your Google search bar, is it the built-in Firefox search bar with the search engine selection drop-down on the left end?
    Do any of these search boxes work:
    * Address bar (also known as URL bar)
    * Built-in Firefox home page (if you use it)
    * Built-in new tab page (if you use it)

Maybe you are looking for