In [1]:
import pandas as pd
import numpy as np

In [2]:
from splinter.browser import Browser

In [3]:
br = Browser()

In [4]:
br.visit('http://www.bringfido.com/lodging/city/san_jose_ca_us/')

In [5]:
archive_links = br.find_by_xpath('//*[@id="results_list"]/div')

In [6]:
one_link = archive_links[1]

In [7]:
one_link.text


Out[7]:
u'Fairmont San Jose\nSan Jose, CA, US\nThe Fairmont San Jose welcomes a maximum of two pets, 60lbs or less, for an additional $75 per stay. Pets may not be left unattended at any time. All rooms are pet friendly.\nHotel Overview | Map | Photos | Guest Reviews\nLow Rates from\n$103 + pet fee\nCHECK RATES'

In [8]:
one_link.find_by_xpath('div/h1/a').value


Out[8]:
u'Fairmont San Jose'

In [9]:
one_link.text


Out[9]:
u'Fairmont San Jose\nSan Jose, CA, US\nThe Fairmont San Jose welcomes a maximum of two pets, 60lbs or less, for an additional $75 per stay. Pets may not be left unattended at any time. All rooms are pet friendly.\nHotel Overview | Map | Photos | Guest Reviews\nLow Rates from\n$103 + pet fee\nCHECK RATES'

In [10]:
one_link.find_by_xpath('div/h1/a')['href']


Out[10]:
u'http://www.bringfido.com/lodging/68322/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=103.2'

In [21]:
one_link['id'].split('_')[-1]


Out[21]:
u'68322'

In [30]:
one_link.find_by_xpath('div/div[@class="photo_inner"]/a/img')['src']


Out[30]:
u'http://www.bringfido.com/site_media/photos/ein/5/2/8/116825/15920_82_b.jpg'

In [14]:
hotel_names = []
text_summaries = []
links = []
biz_ids = []

for lnk in archive_links:
    hotel_names.append(lnk.find_by_xpath('div[2]/h1/a').value)
    biz_ids.append(lnk['id'].split('_')[-1])
    text_summaries.append(lnk.text)
    this_link = lnk.find_by_xpath('div/h1/a')['href']
    links.append(this_link)

In [15]:
links


Out[15]:
[u'http://www.bringfido.com/lodging/68306/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=99.19',
 u'http://www.bringfido.com/lodging/68322/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=103.2',
 u'http://www.bringfido.com/lodging/68296/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=279.3',
 u'http://www.bringfido.com/lodging/68292/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=125.99',
 u'http://www.bringfido.com/lodging/68289/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=69.99',
 u'http://www.bringfido.com/lodging/68307/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=179.01',
 u'http://www.bringfido.com/lodging/68290/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=112.49',
 u'http://www.bringfido.com/lodging/68308/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=329',
 u'http://www.bringfido.com/lodging/68286/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=239',
 u'http://www.bringfido.com/lodging/68320/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=123',
 u'http://www.bringfido.com/lodging/68291/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=69.99',
 u'http://www.bringfido.com/lodging/68303/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=119',
 u'http://www.bringfido.com/lodging/68301/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=69.99',
 u'http://www.bringfido.com/lodging/68324/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=109',
 u'http://www.bringfido.com/lodging/68317/?cid=14455&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=229']

In [16]:
biz_ids


Out[16]:
[u'68306',
 u'68322',
 u'68296',
 u'68292',
 u'68289',
 u'68307',
 u'68290',
 u'68308',
 u'68286',
 u'68320',
 u'68291',
 u'68303',
 u'68301',
 u'68324',
 u'68317']

In [19]:
len(br.find_by_xpath('//*[@id="results_paging_controls_bottom"]/span'))


Out[19]:
3

In [21]:
button = br.find_by_id('page_2')[0]

In [22]:
button


Out[22]:
<splinter.driver.webdriver.WebDriverElement at 0x103663bd0>

In [18]:
button.click()

In [13]:
url_base = 'http://www.bringfido.com'  
hotel_id = 0
link = links[1]
br.visit(link)

In [14]:
hotel_description = br.find_by_xpath('//*[@class="body"]').text

In [15]:
hotel_description


Out[15]:
u'La Quinta Inn Phoenix Arcadia is dog friendly. Two pets of any size are welcome for no additional fee. All rooms are pet friendly. If you find that this pet policy is no longer accurate, please submit a correction now.'

In [16]:
details = br.find_by_xpath('//*[@class="address"]').text.split('\n')

In [17]:
details


Out[17]:
[u'4727 E Thomas Rd',
 u'Phoenix, AZ, US 85018',
 u'877-411-3436',
 u'View Website']

In [18]:
reviews = br.find_by_xpath('//*[@class="review_container"]')

In [19]:
reviews


Out[19]:
[<splinter.driver.webdriver.WebDriverElement at 0x1021dbed0>,
 <splinter.driver.webdriver.WebDriverElement at 0x1021dbd50>,
 <splinter.driver.webdriver.WebDriverElement at 0x1021dbc10>,
 <splinter.driver.webdriver.WebDriverElement at 0x1021dbe90>,
 <splinter.driver.webdriver.WebDriverElement at 0x1021dbc50>,
 <splinter.driver.webdriver.WebDriverElement at 0x1021dbf90>]

Extract the view div content


In [20]:
rev = reviews[0]

In [21]:
# title:
rev.find_by_xpath('div/div[1]').text


Out[21]:
u'Great place to stay!'

In [22]:
# author
rev.find_by_xpath('div/div[2]').text


Out[22]:
u'Jen in Vancouver'

text


In [23]:
rev.find_by_xpath('div/div[3]').text


Out[23]:
u"We've stayed at this La Quinta several times with our two mini schnauzers. The staff is all very friendly. Rooms were clean but not overly fancy - we felt like we didn't need to worry leaving our dogs there for short periods while we went out to eat, etc. In a great location. Great breakfast too!"

rating


In [24]:
rev.find_by_xpath('div[2]/img')['src'].split('/')[-1][0:1]


Out[24]:
u'5'

Now loop through all pages extracting the elements


In [25]:
columns = ['hotel_id',
           'hotel_url',
           'hotel_name',
           'hotel_address',
           'hotel_city',
           'hotel_state',
           'hotel_rating',
           'hotel_latitude',
           'hotel_longitude',
           'review_count',
           'hotel_address',
           'business_id',
           'review_id',
           'user_id',
           'username',
           'review_title',
           'review_text',
           'review_rating',
           'review_date']

bigdf = pd.DataFrame(columns=columns)

for hotel_id, link in enumerate(links):
    print('*'*50)
    print('Now on {}'.format(link))
    print('*'*50)
    br.visit(link)
    
    df = pd.DataFrame(columns=columns)

    hotel_description = br.find_by_xpath('//*[@class="body"]').text

    # scrape the address details section of the page
    details = br.find_by_xpath('//*[@class="address"]').text.split('\n')

    # now get just the address:
    address = details[0]
    
    # and just the city, state, country, and zip code:
    csczip = details[1]
    
    # and just the phone number
    phone = details[2]
    
    # now separate the city, state, and zip:
    city, state, zipcode = csczip.strip().split(',')
    zipcode = zipcode[3:]
    
    #Now using correct Xpath we are fetching URL of archives
    reviews = br.find_by_xpath('//*[@class="review_container"]')

    texts = []
    titles = []
    authors = []
    ratings = []

    print(reviews)
    print('')
    for rev in reviews:
        titles.append(rev.find_by_xpath('div/div[1]').text)
        authors.append(rev.find_by_xpath('div/div[2]').text)
        texts.append(rev.find_by_xpath('div/div[3]').text)
        ratings.append(rev.find_by_xpath('div[2]/img')['src'].split('/')[-1][0:1])
        print(rev.find_by_xpath('div[2]/img')['src'].split('/')[-1][0:1])
    
    df['review_title'] = titles
    df['username'] = authors
    df['review_text'] = texts
    df['review_rating'] = ratings
    df['hotel_id'] = hotel_id
    df['hotel_name'] = hotel_names[hotel_id]
    df['hotel_url'] = link
    df['hotel_address'] = address
    df['hotel_city'] = city
    df['hotel_state'] = state
    df['hotel_rating'] = np.mean([int(rat) for rat in ratings])
    df['hotel_latitude'] = ''
    df['hotel_longitude'] = ''
    df['review_count'] = len(texts)
    df['review_id'] = 0
    df['user_id'] = 0
    
    bigdf = bigdf.append(df)


**************************************************
Now on http://www.bringfido.com/lodging/64846/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=199
**************************************************
[<splinter.driver.webdriver.WebDriverElement object at 0x1095c0610>]

5
**************************************************
Now on http://www.bringfido.com/lodging/64835/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=64
**************************************************
[<splinter.driver.webdriver.WebDriverElement object at 0x1095f00d0>, <splinter.driver.webdriver.WebDriverElement object at 0x1095f0150>, <splinter.driver.webdriver.WebDriverElement object at 0x1095f01d0>, <splinter.driver.webdriver.WebDriverElement object at 0x1095f0250>, <splinter.driver.webdriver.WebDriverElement object at 0x1095f02d0>, <splinter.driver.webdriver.WebDriverElement object at 0x1095f0350>]

5
5
5
4
3
1
**************************************************
Now on http://www.bringfido.com/lodging/64834/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=62
**************************************************
[<splinter.driver.webdriver.WebDriverElement object at 0x1095f0850>]

2
**************************************************
Now on http://www.bringfido.com/lodging/64836/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=64
**************************************************
[<splinter.driver.webdriver.WebDriverElement object at 0x1095f0f10>]

4
**************************************************
Now on http://www.bringfido.com/lodging/64824/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=44.99
**************************************************
[<splinter.driver.webdriver.WebDriverElement object at 0x1095f0650>]

3
**************************************************
Now on http://www.bringfido.com/lodging/132841/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=53
**************************************************
[]

**************************************************
Now on http://www.bringfido.com/lodging/64763/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=329
**************************************************
[<splinter.driver.webdriver.WebDriverElement object at 0x1095f2090>]

5
**************************************************
Now on http://www.bringfido.com/lodging/130968/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=66
**************************************************
[]

**************************************************
Now on http://www.bringfido.com/lodging/64862/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=159
**************************************************
[]

**************************************************
Now on http://www.bringfido.com/lodging/64769/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=71.1
**************************************************
[]

**************************************************
Now on http://www.bringfido.com/lodging/64863/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=319
**************************************************
[]

**************************************************
Now on http://www.bringfido.com/lodging/64794/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=71.2
**************************************************
[]

**************************************************
Now on http://www.bringfido.com/lodging/132840/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=30
**************************************************
[]

**************************************************
Now on http://www.bringfido.com/lodging/64861/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=134.78
**************************************************
[]

**************************************************
Now on http://www.bringfido.com/lodging/64847/?cid=14020&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=199
**************************************************
[]

/Applications/anaconda/lib/python2.7/site-packages/numpy/core/_methods.py:59: RuntimeWarning: Mean of empty slice.
  warnings.warn("Mean of empty slice.", RuntimeWarning)

In [26]:
bigdf


Out[26]:
hotel_id hotel_url hotel_name hotel_address hotel_city hotel_state hotel_rating hotel_latitude hotel_longitude review_count hotel_address business_id review_id user_id username review_title review_text review_rating review_date
0 0 http://www.bringfido.com/lodging/64846/?cid=14... Pointe Hilton Squaw Peak Resort 7677 North 16th Street Phoenix AZ 5.000000 1 7677 North 16th Street NaN 0 0 Marti Ackermann in Tucson, AZ Pointe Hilton Squaw Peak Really nice property. Great walking areas for ... 5 NaN
0 1 http://www.bringfido.com/lodging/64835/?cid=14... La Quinta Inn Phoenix Arcadia 4727 E Thomas Rd Phoenix AZ 3.833333 6 4727 E Thomas Rd NaN 0 0 Jen in Vancouver Great place to stay! We've stayed at this La Quinta several times w... 5 NaN
1 1 http://www.bringfido.com/lodging/64835/?cid=14... La Quinta Inn Phoenix Arcadia 4727 E Thomas Rd Phoenix AZ 3.833333 6 4727 E Thomas Rd NaN 0 0 Jody in Sierra Vista, AZ Awesome Staff!! This place was awesome!! The entire staff was ... 5 NaN
2 1 http://www.bringfido.com/lodging/64835/?cid=14... La Quinta Inn Phoenix Arcadia 4727 E Thomas Rd Phoenix AZ 3.833333 6 4727 E Thomas Rd NaN 0 0 Kristi in Henderson NV Very dog friendly We've stayed at this hotel two times with our ... 5 NaN
3 1 http://www.bringfido.com/lodging/64835/?cid=14... La Quinta Inn Phoenix Arcadia 4727 E Thomas Rd Phoenix AZ 3.833333 6 4727 E Thomas Rd NaN 0 0 Christopher in Los Angeles All around great place to stay. My room while a bit small was very clean and t... 4 NaN
4 1 http://www.bringfido.com/lodging/64835/?cid=14... La Quinta Inn Phoenix Arcadia 4727 E Thomas Rd Phoenix AZ 3.833333 6 4727 E Thomas Rd NaN 0 0 Dave in Sedona Management and customer service The big gentleman who manages the front desk i... 3 NaN
5 1 http://www.bringfido.com/lodging/64835/?cid=14... La Quinta Inn Phoenix Arcadia 4727 E Thomas Rd Phoenix AZ 3.833333 6 4727 E Thomas Rd NaN 0 0 Teri in Southern California Bad Experience. I was driving from So Cal to Houston, TX for t... 1 NaN
0 2 http://www.bringfido.com/lodging/64834/?cid=14... La Quinta Inn Phoenix North 2510 WGreenway Rd Phoenix AZ 2.000000 1 2510 WGreenway Rd NaN 0 0 emma in park city no dog area the hotel was fine but it is all hard scape ar... 2 NaN
0 3 http://www.bringfido.com/lodging/64836/?cid=14... La Quinta Inn Phoenix Thomas Road 2725 N Black Canyon Hwy Phoenix AZ 4.000000 1 2725 N Black Canyon Hwy NaN 0 0 Scruffy in CA Recommended! Hotel has a grass area and dog potty station. ... 4 NaN
0 4 http://www.bringfido.com/lodging/64824/?cid=14... Crossland Economy Studios Phoenix Metro 2102 W Dunlap Ave Phoenix AZ 3.000000 1 2102 W Dunlap Ave NaN 0 0 Melissa in Kingman, AZ Needs improvement My room in general was in need of a lot of gen... 3 NaN
0 6 http://www.bringfido.com/lodging/64763/?cid=14... Arizona Biltmore Waldorf Astoria 2400 E Missouri Ave Phoenix AZ 5.000000 1 2400 E Missouri Ave NaN 0 0 Karrie in Friendship ME Gus & Luna Pampered at the Arizona Biltmore Very dog friendly. Aimee at the front desk was... 5 NaN

In [27]:
len(bigdf)


Out[27]:
11

Add reviews to DB


In [31]:
import sqlalchemy
import connect_aws_db as cadb

In [41]:
engine = cadb.connect_aws_db(write_unicode=True)

In [42]:
conn = engine.connect()

In [43]:
cmd = "DROP TABLE bf_reviews"
result = conn.execute(cmd)

In [44]:
cmd = """
        CREATE TABLE bf_reviews
        (
        review_id MEDIUMINT AUTO_INCREMENT,
        hotel_id VARCHAR(256),
        hotel_url VARCHAR(512),
        hotel_img_url VARCHAR(512),
        business_id VARCHAR(256),
        user_id MEDIUMINT,
        username VARCHAR(128),
        review_title VARCHAR(256),
        review_rating INT,
        review_text VARCHAR(5000),
        PRIMARY KEY (review_id)
        )
        """

In [45]:
result = conn.execute(cmd)

In [34]:
bigdf_reviews = bigdf[['hotel_id', 'review_id', 'business_id', 'user_id',
                      'username', 'review_title', 'review_text', 'review_rating']].copy()

In [35]:
bigdf_reviews.to_sql('bf_reviews', engine, if_exists='append', index=False)

In [46]:
cmd = "DROP TABLE bf_hotels"
result = conn.execute(cmd)

In [47]:
cmd = """
        CREATE TABLE bf_hotels
        (
        hotel_id MEDIUMINT AUTO_INCREMENT,
        hotel_url VARCHAR(512),
        hotel_img_url VARCHAR(512),
        hotel_name VARCHAR(512),
        hotel_address VARCHAR(1024),
        hotel_city VARCHAR(512),
        hotel_state VARCHAR(32),
        hotel_rating INT(11),
        hotel_latitude FLOAT,
        hotel_longitude FLOAT,
        business_id VARCHAR(256),
        review_count MEDIUMINT,
        PRIMARY KEY (hotel_id)
        )
        """

In [48]:
result = conn.execute(cmd)

Add second page of bringfido Phoenix reviews


In [39]:
#page_1_url = "http://www.bringfido.com/lodging/city/phoenix_az_us/?arrival=None&adults=1&fee_under_25=False&rate_low=0&multiple_allowed=False&departure=None&dogs=0&rate_high=1000&rating_high=5&rooms=1&rating_low=0&large_allowed=False&nofee=False&deposit_only=False&type=&children=0&location=Phoenix%2C+AZ%2C+US"
# palo alto
br.visit('http://www.bringfido.com/lodging/city/palo_alto_ca_us')

In [40]:
archive_links = br.find_by_xpath('//*[@id="results_list"]/div')

hotel_names = []
text_summaries = []
links = []

for lnk in archive_links:
    hotel_names.append(lnk.find_by_xpath('div[2]/h1/a').value)
    text_summaries.append(lnk.text)
    this_link = lnk.find_by_xpath('div/h1/a')['href']
    links.append(this_link)

links


Out[40]:
[u'http://www.bringfido.com/lodging/67427/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=199',
 u'http://www.bringfido.com/lodging/67422/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=575',
 u'http://www.bringfido.com/lodging/67419/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=108',
 u'http://www.bringfido.com/lodging/67420/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=149',
 u'http://www.bringfido.com/lodging/67421/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=369',
 u'http://www.bringfido.com/lodging/67431/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=499',
 u'http://www.bringfido.com/lodging/67416/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=150',
 u'http://www.bringfido.com/lodging/128142/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=335']

In [41]:
columns = ['hotel_id',
           'hotel_url',
           'hotel_name',
           'hotel_address',
           'hotel_city',
           'hotel_state',
           'hotel_rating',
           'hotel_latitude',
           'hotel_longitude',
           'review_count',
           'hotel_address',
           'business_id',
           'review_id',
           'user_id',
           'username',
           'review_title',
           'review_text',
           'review_rating',
           'review_date']

bigdf = pd.DataFrame(columns=columns)

for hotel_id, link in enumerate(links):
    print('*'*50)
    print('Now on {}'.format(link))
    print('*'*50)
    br.visit(link)
    
    df = pd.DataFrame(columns=columns)

    hotel_description = br.find_by_xpath('//*[@class="body"]').text

    # scrape the address details section of the page
    details = br.find_by_xpath('//*[@class="address"]').text.split('\n')

    # now get just the address:
    address = details[0]
    
    # and just the city, state, country, and zip code:
    csczip = details[1]
    
    # and just the phone number
    phone = details[2]
    
    # now separate the city, state, and zip:
    city, state, zipcode = csczip.strip().split(',')
    zipcode = zipcode[3:]
    
    #Now using correct Xpath we are fetching URL of archives
    reviews = br.find_by_xpath('//*[@class="review_container"]')

    texts = []
    titles = []
    authors = []
    ratings = []

    print(reviews)
    print('')
    for rev in reviews:
        titles.append(rev.find_by_xpath('div/div[1]').text)
        authors.append(rev.find_by_xpath('div/div[2]').text)
        texts.append(rev.find_by_xpath('div/div[3]').text)
        ratings.append(rev.find_by_xpath('div[2]/img')['src'].split('/')[-1][0:1])
        print(rev.find_by_xpath('div[2]/img')['src'].split('/')[-1][0:1])
    
    df['review_title'] = titles
    df['username'] = authors
    df['review_text'] = texts
    df['review_rating'] = ratings
    df['hotel_id'] = hotel_id
    df['hotel_name'] = hotel_names[hotel_id]
    df['hotel_url'] = link
    df['hotel_address'] = address
    df['hotel_city'] = city
    df['hotel_state'] = state
    df['hotel_rating'] = np.mean([int(rat) for rat in ratings])
    df['hotel_latitude'] = ''
    df['hotel_longitude'] = ''
    df['review_count'] = len(texts)
    df['review_id'] = 0
    df['user_id'] = 0
    
    bigdf = bigdf.append(df)


**************************************************
Now on http://www.bringfido.com/lodging/67427/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=199
**************************************************
[<splinter.driver.webdriver.WebDriverElement object at 0x1053eaa90>]

3
**************************************************
Now on http://www.bringfido.com/lodging/67422/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=575
**************************************************
[<splinter.driver.webdriver.WebDriverElement object at 0x1053f63d0>, <splinter.driver.webdriver.WebDriverElement object at 0x1053f6590>]

5
5
**************************************************
Now on http://www.bringfido.com/lodging/67419/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=108
**************************************************
[<splinter.driver.webdriver.WebDriverElement object at 0x1053eaed0>]

5
**************************************************
Now on http://www.bringfido.com/lodging/67420/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=149
**************************************************
[<splinter.driver.webdriver.WebDriverElement object at 0x1053eadd0>]

1
**************************************************
Now on http://www.bringfido.com/lodging/67421/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=369
**************************************************
[]

**************************************************
Now on http://www.bringfido.com/lodging/67431/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=499
**************************************************
[]

**************************************************
Now on http://www.bringfido.com/lodging/67416/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=150
**************************************************
[]

**************************************************
Now on http://www.bringfido.com/lodging/128142/?cid=14392&ar=&dt=&rm=1&ad=1&ch=0&dg=1&rt=335
**************************************************
[]


In [42]:
bigdf_reviews = bigdf[['hotel_id', 'review_id', 'business_id', 'user_id',
                      'username', 'review_title', 'review_text', 'review_rating']].copy()

bigdf_reviews.to_sql('bf_reviews', engine, if_exists='append', index=False)

In [ ]: