import time import json from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities import time import os 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 import requests import datetime import dataset import time import traceback import sys import fire #from INNNews import notifytest db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4') term=None domain='hhh.com.tw' address="192.168.192.45:9922" cursor=db.query('SELECT term FROM seo.selected_kw where client = "hhh" order by rand() limit 1') for c in cursor: term=c['term'] break if os.name == 'nt': py='python' else: py='python3' os.system(py+' general_remote_click.py get --kw="'+term+'" --domain='+domain+' --address="'+address+'"')