python - Extract URL from .url file -
is possible read actual url .urlfile, described here, python?
in following image instance, can print mapbox-osm bright- carto template openstreetmap data extract actual url: https://github.com/mapbox/osm-bright
i need extract hundreds of urls , using batch file job done, rather python. using python 2.7.11 3 possibility well.
i assume mean url file described here. files have syntax similar .ini-files , can parsed this:
import configparser config = configparser.rawconfigparser() config.read('example.url') try: url = config.get('internetshortcut', 'url') # classic url format except configparser.nooptionerror: url = config.get('default', 'baseurl') # extended url format 