How can I make my program execute only when a certain webpage is opened.? For example I want to execute my program only when I visit the webpage www.google.com.
So far I made my program execute only when the given webpage is up by using the lines below, but how can I execute only when user view the page google.com?
loop_value = 1
while (loop_value == 1):
try:
urllib2.urlopen('http://google.com')
except urllib2.URLError, e:
time.sleep(10)
else:
loop_value = 0
main()
Any suggestions would be appreciated. Thanks!