File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Beautifulsoup_WebScraping Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ #! python3
2+ # mapIt.py - Launches a map in the browser using an address from the
3+ # command line or clipboard.
4+
5+ # Importing all the necessary Libraries.
6+ import webbrowser # Used for opening google maps website
7+ import sys # For Retrirving the address from the commandline
8+ import pyperclip # To Retrieve the address from the clipboard.
9+
10+ # get the address from either the command line or clipboard.
11+ if len (sys .argv ) > 1 :
12+ # Get address from the command line
13+ ## As the sys.argv[0] is the program name
14+ addr = ' ' .join (sys .argv [1 :])
15+
16+ # Get the address from teh clipboard if the address
17+ # is not passed as an argument in the commandline.
18+ else :
19+ addr = pyperclip .paste ()
20+
21+
22+ # pyperclip.copy('870 Valencia St, San Francisco, CA 94110')
23+ # addr = pyperclip.paste()
24+
25+ #
26+ address = addr .replace (',' , '' ).split (' ' )
27+ webbrowser .open ('https://www.google.com/maps/place/' + str ('+' .join (address )) + '/' )
You can’t perform that action at this time.
0 commit comments