Commit 0510940d authored by wang's avatar wang

wn test

parent dd1bb42f
...@@ -26,7 +26,8 @@ client = MongoClient('mongodb://lcc-spider:JIUsfhiad&^@18.144.59.80:27017/?authS ...@@ -26,7 +26,8 @@ client = MongoClient('mongodb://lcc-spider:JIUsfhiad&^@18.144.59.80:27017/?authS
db = client.env db = client.env
# 查询所有文档 # 查询所有文档
if platform.uname().system != 'Darwin': if platform.uname().system != 'Darwin':
result = db.env_shape.find({'env.funcs' :{'$ne': None}, 'success': {'$gte': 30}}) # , 'success': {'$gte': 30}
result = db.env_shape.find({'env.funcs' :{'$ne': None}, 'env.navigatorparams.useragent': {'$regex': 'iPhone'}})
data = {str(x['_id']): x['env'] for x in result} data = {str(x['_id']): x['env'] for x in result}
print(result) print(result)
with open('env.json', 'w', encoding='utf-8') as f: with open('env.json', 'w', encoding='utf-8') as f:
......
No preview for this file type
This diff is collapsed.
...@@ -26,7 +26,8 @@ client = MongoClient('mongodb://lcc-spider:JIUsfhiad&^@18.144.59.80:27017/?authS ...@@ -26,7 +26,8 @@ client = MongoClient('mongodb://lcc-spider:JIUsfhiad&^@18.144.59.80:27017/?authS
db = client.env db = client.env
# 查询所有文档 # 查询所有文档
if platform.uname().system != 'Darwin': if platform.uname().system != 'Darwin':
result = db.env_shape.find({'env.funcs' :{'$ne': None}, 'success': {'$gte': 30}}) # , 'success': {'$gte': 30}
result = db.env_shape.find({'env.funcs' :{'$ne': None}, 'env.navigatorparams.useragent': {'$regex': 'iPhone'}})
data = {str(x['_id']): x['env'] for x in result} data = {str(x['_id']): x['env'] for x in result}
print(result) print(result)
with open('env.json', 'w', encoding='utf-8') as f: with open('env.json', 'w', encoding='utf-8') as f:
...@@ -36,6 +37,7 @@ with open('env.json', 'r', encoding='utf-8') as f: ...@@ -36,6 +37,7 @@ with open('env.json', 'r', encoding='utf-8') as f:
data = json.loads(f.read()) data = json.loads(f.read())
envs = data.keys() envs = data.keys()
print(len(envs))
# session = requests.session() # session = requests.session()
headers = { headers = {
......
No preview for this file type
This diff is collapsed.
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