Commit 83497141 authored by wang's avatar wang

ws 测试

parent 51d56260
This diff is collapsed.
......@@ -32,6 +32,28 @@ def md5(text):
# 连接MongoDB数据库
client = MongoClient('mongodb://lcc-spider:JIUsfhiad&^@13.52.65.111:27017/?authSource=admin&directConnection=true')
db = client.env
def get_random_one():
query = {
'env.funcs': {'$ne': None},
'env.fontsres': {'$ne': None},
'env.matchmedias': {'$ne': None},
'env.navigatorparams.platform': 'MacIntel',
# 'env.navigatorparams.platform': 'Win32',
"env.navigatorparams.vendor": "Google Inc.",
'env.useragentdata.highvalue.uafullversion': {'$ne': ""}
}
res = list(db.env_shape.aggregate([
{'$match': query},
{'$sample': {'size': 1}}
]))
path = f'/tmp/{str(res[0]["_id"])}'
with open(path, 'w') as f:
f.write(json.dumps(res[0]['env']))
print(path)
return path
# 查询所有文档
#platform.uname().system != 'Darwin' and not
if not pathlib.Path('env.json').exists():
......@@ -206,7 +228,7 @@ while True:
# p = subprocess.Popen(['node', 'js_dom_run1.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
# p = subprocess.Popen(['node', 'src_run_chrome_105.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
# p = subprocess.Popen(['node', 'src_run_company_chrome.js', selectId, '11', token], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
p = subprocess.Popen(['node', 'src_run3.js', selectId,f'z0t0U8fo={ck}', '11', token, proxy], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
p = subprocess.Popen(['node', 'src_run3.js', selectId,f'z0t0U8fo={ck}', get_random_one(), token, proxy], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
output, err = p.communicate(timeout=30)
# tmp = ''
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment