Created
April 12, 2021 13:54
Revisions
-
ian-kerins created this gist
Apr 12, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ from urllib.parse import urlparse from urllib.parse import urlencode def create_google_url(query, site=''): google_dict = {'q': query, 'num': 100, } if site: web = urlparse(site).netloc google_dict['as_sitesearch'] = web return 'http://www.google.com/search?' + urlencode(google_dict) return 'http://www.google.com/search?' + urlencode(google_dict)