Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandhunt committed Jan 22, 2020
1 parent f60b486 commit ef68143
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions scraper.py
@@ -1,4 +1,4 @@
from collections import namedtuple
'''from collections import namedtuple
import datetime as dt
from functools import reduce
import itertools as it
Expand All @@ -7,7 +7,17 @@
from urllib.parse import parse_qs, urljoin, urlparse, quote as urlquote
from selenium.common.exceptions import WebDriverException
from splinter import Browser'''

import logging
import scraperwiki
import sqlite3
import time
import urllib2
import lxml.html
from splinter import Browser
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.chrome.options import Options

# This is a template for a Python scraper on morph.io (https://morph.io)
# including some code snippets below that you should find helpful
Expand Down Expand Up @@ -37,19 +47,26 @@
#import warnings
#warnings.filterwarnings("ignore")

options = Options()
options.add_argument('--disable-extensions')
options.add_argument('--no-sandbox')

hend = 'CHANGE'
print('HEPP')
#browser = Browser("phantomjs")
with Browser('chrome') as browser:
with Browser('chrome', headless=True, options=options) as browser:
browser.driver.set_window_size(1920, 1080)
browser.visit('https://morph.io')
hend = browser.html
#text = browser.find_by_css('button.btn-primary')
#hend = text
#for t in text:
#print(t)
#print(t.text)
#print(t.html)
#hend = t['href']
try:
browser.visit('https://morph.io')
hend = browser.html
#text = browser.find_by_css('button.btn-primary')
#hend = text
#for t in text:
#print(t)
#print(t.text)
#print(t.html)
#hend = t['href']
except:
print('HAPP')
print('HUPP')
print(hend)

0 comments on commit ef68143

Please sign in to comment.