I wrote a script to find the position in Google search result for a search keyword. I also did the same with the browser. The two results are different.
Let me explain in detail here. I have a website and I wanted to know on which page number my domain appears for a search string. Like when I search for 'code snippets' I wanted to find in Google search on which page number a certain domain appears.
I wrote a PHP script to search page by page starting from page 1 to page n. Then I did the same task using a browser. The script returned page 4 and when browsed I can see the domain appearing on the second page.
Here is the search string I used in my code.
For each request I change the
and in the response I will check whether my domain appears in it.
Any idea why this is different in search results?