Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-shape
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wangmingming
lcc-shape
Commits
83497141
Commit
83497141
authored
Sep 11, 2024
by
wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws 测试
parent
51d56260
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
env.json
ws/src/env.json
+0
-1
main.py
ws/src/main.py
+23
-1
src2.js
ws/src/src2.js
+2
-2
No files found.
ws/src/env.json
deleted
100644 → 0
View file @
51d56260
This diff is collapsed.
Click to expand it.
ws/src/main.py
View file @
83497141
...
...
@@ -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 = ''
...
...
ws/src/src2.js
View file @
83497141
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment