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
75796e98
authored
Aug 10, 2017
by
马玮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
easypass ended
parent
199080ab
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
README.md
+2
-3
lib/dealerspider/autohome.js
+4
-3
lib/dealerspider/easypass.js
+0
-0
No files found.
README.md
View file @
75796e98
...
...
@@ -17,5 +17,4 @@ Installation
To do list:
------
1.
Add random delay when access a page
2.
Add error stack
\ No newline at end of file
1.
Fetch easypass clues
\ No newline at end of file
lib/dealerspider/autohome.js
View file @
75796e98
...
...
@@ -101,7 +101,7 @@ class AutoHome {
}
catch
(
e
)
{
console
.
log
(
e
.
message
);
}
console
.
log
(
'
成功就不走这
'
);
console
.
log
(
'
开始表单登录
'
);
const
username
=
this
.
params
.
username
;
const
password
=
this
.
params
.
password
;
...
...
@@ -114,7 +114,7 @@ class AutoHome {
horseman
.
userAgent
(
'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0'
)
.
viewport
(
1920
,
1080
)
.
open
(
'http://ics.autohome.com.cn/passport/
Home/Index
'
);
.
open
(
'http://ics.autohome.com.cn/passport/'
);
horseman
.
on
(
'onResourceRequested'
,
(
requestData
,
networkRequest
)
=>
{
console
.
info
(
'Requesting'
,
requestData
.
url
);
...
...
@@ -164,6 +164,7 @@ class AutoHome {
.
waitForNextPage
({
timeout
:
5000
})
.
screenshot
(
'm3.png'
)
.
exists
(
'#loginout'
);
if
(
loginSuccess
)
{
console
.
log
(
'登录成功!'
);
const
cookies
=
await
horseman
.
cookies
().
close
();
...
...
@@ -202,7 +203,7 @@ class AutoHome {
const
Cookie
=
tough
.
Cookie
;
cookies
.
forEach
((
cookieObj
)
=>
{
let
cookieStr
=
cookieObj
.
name
+
"="
+
cookieObj
.
value
+
"; path="
+
cookieObj
.
path
+
"; domain="
+
cookieObj
.
domain
;
let
cookieStr
=
cookieObj
.
name
+
'='
+
cookieObj
.
value
+
'; path='
+
cookieObj
.
path
+
'; domain='
+
cookieObj
.
domain
;
cookieJar
.
setCookieSync
(
cookieStr
,
'http://ics.autohome.com.cn'
);
});
...
...
lib/dealerspider/easypass.js
View file @
75796e98
This diff is collapsed.
Click to expand it.
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