2019-12-18 16:19:21 -05:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
import psycopg2
|
2019-12-18 16:23:48 -05:00
|
|
|
import wget
|
2019-12-18 16:19:21 -05:00
|
|
|
import sys
|
|
|
|
|
|
|
|
con = None
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
con = psycopg2.connect(database='ubm', user='ptrowbridge', port=5030, host='usmidlnx01',
|
|
|
|
password='qqqx53!030')
|
|
|
|
|
|
|
|
cur = con.cursor()
|
|
|
|
cur.execute('SELECT code, url FROM scrape.raw')
|
|
|
|
|
2019-12-18 16:23:48 -05:00
|
|
|
urls = cur.fetchall()
|
|
|
|
for row in urls:
|
|
|
|
print(row[0],row[1])
|
2019-12-18 16:19:21 -05:00
|
|
|
|
|
|
|
except psycopg2.DatabaseError as e:
|
|
|
|
|
|
|
|
print(f'Error {e}')
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
finally:
|
|
|
|
|
|
|
|
if con:
|
|
|
|
con.close()
|