troubleshooting Question

PHP Script:  Input Multiple Search Queries to Google Search Engine

Avatar of Jerry L
Jerry LFlag for United States of America asked on
Web DevelopmentWeb ApplicationsPHP
5 Comments1 Solution509 ViewsLast Modified:
Can someone help me writh some PHP code to do the following:

GOAL:
1. Submit multiple search queries (up to 100) to Google and pair the search string with the number of results found. I then want to save these paired results in a .csv file in a two column format. There will need to be a delay of 1 or 2 seconds between query submisisons to avoid incurring a spamming penalty.

3. Perhaps the results can be simply displayed in two columns in a browser window/tab which I can then copy and paste into a text file.  This will avoid the obvious problem of having the script trying to wrie to a file on the hard drive.

4. If a Database is needed we would have to do this as a Wordpress plugin.

5. It may be necessary to display the Google search output as either,
a) separate frames in one browser window, or
b) separate tabs
and then parse the source.

6. Perhaps the parsing can be done directly from the browser window?

7. Google displays the following text (from source code) which includes the number I'm looking to associate with the search string:  

           Results <b>1</b> - <b>10</b> of about <b>173,000</b>


EXAMPLE INPUT: ( single column of strings copied from Excel )
string one
string two
"string three"
"string four"


EXAMPLE OUTPUT:
Column One      Column Two
string one              173,000
string two                     123
string three                2,345          < Notice, no quotes needed here
string four                13,101
   
etc.

ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros