You're viewing a comment by Nemanja Krecelj and its responses.

January 22, 2013, 18:01

Hello, first thank for this share, i need this working to check position of my domain for specific KW. I tried this:

import re
from urlparse import urlparse
from import GoogleSearch, SearchError

target_domain = ""
target_keyword = "python videos"

def mk_nice_domain(domain):
convert domain into a nicer one (eg. into
domain = re.sub("^www(\d+)?\.", "", domain)
# add more here
return domain

gs = GoogleSearch(target_keyword)
gs.results_per_page = 100
results = gs.get_results()
for idx, res in enumerate(results):
parsed = urlparse(res.url)
domain = mk_nice_domain(parsed.netloc)
if domain == target_domain:
print "Ranking position %d for keyword '%s' on domain %s" % (idx+1, target_keyword, target_domain)


And its working fine, but when i change that KW's its not working i get in my terminal something like this:

tripz0r-iMac-2:~ tripz0r$ python /Users/tripz0r/Desktop/urldigger-02c/
Ranking position 5 for keyword 'python videos' on domain
tripz0r-iMac-2:~ tripz0r$ python /Users/tripz0r/Desktop/urldigger-02c/
tripz0r-iMac-2:~ tripz0r$

So no any result when i change KW and URL in:

target_domain = ""
target_keyword = "my kw"

Any suggestion, how to fix it?

And also one question i have for you, could this software search for some KW for 100 pages in Google? Or just in first 10 or?

Thanks so much with sharing this.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "linux_139": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.