D.Tech Academic
Deep Singh
Pages
Core Java
Web App
Spring
Hibernate
Kotlin
Android
Python
Flutter
Spring Boot
Open Chrome using java and search content in google.
Open chrome and search content in google using Java
import java.io.IOException; import java.util.Scanner; public class OpenChromeAndSearchInGoogle { public static void main(String[] args) { Scanner s=new Scanner(System.in); System.out.println("Enter content to be search :- "); String search=s.next(); String url="https://www.google.co.in/search?q="+search+""; try { Runtime r = Runtime.getRuntime(); String[] data = new String[] {"C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",url}; r.exec(data); } catch (IOException e) { System.out.println("There is some Problem : - " + e); } } }
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment