In [1]:
from urllib.request import urlopen # Library for urlopen
from bs4 import BeautifulSoup # Library for html parser (scraper), lxml is also nice
import pandas as pd
import re
import sys
sys.path.append('..')
from uni_cache.cache_function import cache_function
import pymysql
import collections
import mysql_credits
In [2]:
# This folder should be edited according to this project path on yours computer
project_folder = '/home/bogdan/PycharmProjects/universities_sentiment/'
cache_folder = project_folder + 'cache/'
site = 'https://www.whatuni.com/university-course-reviews/university-of-oxford/3757/'
connection = pymysql.connect(
host=mysql_credits.db_host,
user=mysql_credits.db_user,
password=mysql_credits.db_password,
db=mysql_credits.db,
charset='utf8mb4',
cursorclass=pymysql.cursors.DictCursor
)
In [ ]: