from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities import time import os import datetime import urllib.parse from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC import codecs import random from bs4 import BeautifulSoup import requests import time import rpyc import sys import docker import googlesearch import codecs import sys import time import dataset import os db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/hhh?charset=utf8mb4') table=db['contentgap_terms'] curdir=os.path.realpath('.') #fr=codecs.open(curdir+os.sep+'contentgap.txt','r','utf-8') #fr=codecs.open(curdir+os.sep+'hhh\\seo\\contentgap.txt','r','utf-8') fr=codecs.open('C:\\gitlab\\kw_tools\\kw_tools\\hhh\\SEO\\contentgap.txt','r','utf-8') lines=fr.readlines() lst=[] for l in lines: term=l.replace('\n','') table.insert({'term':term})