Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
马玮
/
carspider
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
076d512c
authored
Aug 22, 2017
by
马玮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix capture store
parent
e42429be
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
accountTool.js
+1
-1
lib/captcha/index.js
+1
-2
lib/spider/dealer/Autohome.js
+2
-2
No files found.
accountTool.js
View file @
076d512c
...
...
@@ -34,7 +34,7 @@ if (!program.password) {
}
const
validTasks
=
[
'saveAccount'
];
if
(
program
.
task
&&
!
validTasks
.
includes
(
program
.
task
))
{
commandError
.
push
(
'
网站
类型不合法!'
);
commandError
.
push
(
'
任务
类型不合法!'
);
}
const
validWebsites
=
[
'autohome'
,
'easypass'
];
...
...
lib/captcha/index.js
View file @
076d512c
...
...
@@ -14,9 +14,8 @@ captcha.decode = async (captchaType, imageFile) => {
captcha
.
decodeBase64
=
async
(
captchaType
,
base64Text
)
=>
{
const
imageFile
=
'tmp/captcha/'
+
(
new
Date
)
.
getTime
()
+
'.gif'
;
const
writeStream
=
fs
.
createWriteStream
(
imageFile
);
// data:image/png;base64, + base64Text
writeStream
.
write
(
base64Text
,
'base64'
);
fs
.
writeFileSync
(
imageFile
,
base64Text
,
'base64'
);
if
(
fs
.
existsSync
(
imageFile
)
&&
fs
.
statSync
(
imageFile
).
isFile
())
{
const
captchaText
=
this
.
decode
(
captchaType
,
imageFile
);
...
...
lib/spider/dealer/Autohome.js
View file @
076d512c
...
...
@@ -158,8 +158,8 @@ class Autohome {
await
horseman
.
click
(
'[id="btnDealer"]'
)
.
wait
(
2
000
)
.
waitForNextPage
({
timeout
:
10000
})
.
wait
(
1
000
)
//
.waitForNextPage({ timeout: 10000 })
.
screenshot
(
'tmp/workflow/autohome/submitLoginForm.png'
)
.
exists
(
'#loginout'
);
...
...
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