1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- 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
- probdict={}
- probdict[0]={'client':'hhh','domain':'hhh.com.tw'}
- probdict[1]={'client':'毛怪','domain':'beastparadise.net'}
- probdict[2]={'client':'清原','domain':'taroboba-yuan.com'}
- db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
- prob=[0,0,0,0,1,1,2,2]
- idx=random.choice(prob)
- client=probdict[idx]['client']
- domain=probdict[idx]['domain']
- term=None
- address="192.168.192.45:9922"
- cursor=db.query('SELECT term FROM seo.selected_kw where client = "'+client+'" order by rand() limit 1')
- for c in cursor:
- term=c['term']
- break
- if os.name == 'nt':
- py='python'
- else:
- py='python3'
- #set WEBDRIVER=C:/portable/webdriver/chrome98/chromedriver.exe
- #os.system(py+' general_remote_click.py get --kw="'+term+'" --domain='+domain+' --address="'+address+'" --epath="C:/portable/webdriver/chrome98/chromedriver.exe"')
- os.system(py+' general_remote_click.py get --kw="'+term+'" --domain='+domain+' --address="'+address+'"')
|