Write a program that takes in input a set of search terms


write a program that takes in input a set of search terms, connects to Google's search engine, queries for the search terms, retrieves the HTML page containing the search results, parses the HTML results page to extract the URL of the top 5 search results, and outputs these top 5 URLs into a text file. The program must take the following command line arguments: -q "Query Keywords Here" -o OutputFile The -q argument is used to give the program the set of keywords to be queried on Google's search engine. The -o argument is the file where the program output must be stored. The program must also accept an additional -f option: -f InputFileName The -f option tells the program to read the HTML page containing the search results from a file, rather than retrieving it from the web. Essentially, the -f argument allows you to manually query Google's search engine, manually save the HTML page containing the search results into a file, and then pass this file to your program for parsing to extract again the top 5 URLs. Notice that the -o argument must always be present. On the other hand, -f is in alternative to -q. If both -f and -q are given, the program will ignore -q and only use the file provided as argument to -f for parsing. For example, the program (after it is compiled) needs to run as $ java GoogleScraper -q "UGA computer science" -o uga_search.txt or as $ java GoogleScraper -f uga_google_results.html -o uga_search.txt

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Write a program that takes in input a set of search terms
Reference No:- TGS0570323

Expected delivery within 24 Hours