Skip to content

Instantly share code, notes, and snippets.

@khambadkone
khambadkone / search.py
Last active May 28, 2016 07:25
Check if a site contains a word
# Google does a great job searching for keywords on a site
# If there are none, their reponse always includes "did not match any documents"
import urllib2
import sys
site = sys.argv[1]
word = sys.argv[2]
# need the user-agent so google wont return a 403
headers = {'User-agent':'Mozilla/11.0'}