/    Sign up×
Community /Pin to ProfileBookmark

How to extract search result count from search engines

Hi everyone, I’m a newbie here, not only to this forum but also to PHP, and I need your help!

Recently I got a task on extracting search result count from search engines and store the search word, date, and result count somewhere, when needed importing the data to excel.

I’m thinking about using PHP+MySQL for this purpose. Honestly I don’t know how to start :o. Do you know any PHP scripts out there already available that I can use as a start point? Or do you have the script you can share with me?

Any tips and advice will be greatly appreciated!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@rtretheweyMay 02.2012 — There's several ways to approach this, of course. Essentially, you read the server log file and check the REFERER field for traffic from the search engines. When you locate an entry, you need to parse the REFERER's query string for the user search query. From there, it's up to you to decide what to do with that information. For several reasons, I'd suggest that you filter out common words like "the", "a", "an", "who", "what", "where", "if" "and", "but", etc. so that you don't needlessly track them as individual keywords. Then you need to decide if you want to track entire search queries, or just the individual keywords. As I say, there's lots of ways to do this. The best thing is to just dig in and see how it goes for your project. I'm sure you can find server log parsing scripts out there to get you started. Good luck!
Copy linkTweet thisAlerts:
@inazhangauthorMay 03.2012 — Hi Rick,

Thanks for the tip! Although I think I may not describe my question correctly. The data I want to scrap is the search result count. Say I search "Adele" (my current favorite singer ?) on Google, then I get "About 85,100,000 results (0.34 seconds)" on the search result page. The number 85,100,000 is the one I want to get. I checked REFERE and for my understanding, it would be good for visit count, am I correct?

Thanks!
×

Success!

Help @inazhang spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...