You're replying to a comment by Nemanja Krecelj.

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 xgoogle.search import GoogleSearch, SearchError

target_domain = "catonmat.net"
target_keyword = "python videos"

def mk_nice_domain(domain):
"""
convert domain into a nicer one (eg. www3.google.com into google.com)
"""
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/google.py
Ranking position 5 for keyword 'python videos' on domain catonmat.net
tripz0r-iMac-2:~ tripz0r$ python /Users/tripz0r/Desktop/urldigger-02c/google.py
tripz0r-iMac-2:~ tripz0r$

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

target_domain = "mywebsite.net"
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 name, if you have one. (I'm @pkrumins, btw.))

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

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