Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
almighty-parser-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tf-boys
almighty-parser-core
Commits
b3edf85a
Commit
b3edf85a
authored
Aug 10, 2017
by
zhaochangbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add xss
parent
65c4c9be
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
parser.js
lib/parser.js
+8
-2
package.json
package.json
+3
-2
No files found.
lib/parser.js
View file @
b3edf85a
...
...
@@ -4,7 +4,10 @@ var async = require('async'),
xpath
=
require
(
'xpath'
),
dom
=
require
(
'xmldom'
).
DOMParser
;
var
helper
=
require
(
'./helper'
);
var
xss
=
require
(
'xss'
)
const
xssoptions
=
{
stripIgnoreTagBody
:
[
'script'
]
}
/**
* 解析器
*/
...
...
@@ -68,7 +71,7 @@ var _jquerySelectorParser = function ($, item) {
}
}
});
return
data
;
return
xss
(
data
,
xssoptions
)
;
};
// 上下文解析器
var
_contextSelectorParser
=
function
(
body
,
item
)
{
...
...
@@ -112,6 +115,9 @@ var _completionUrl = function (url, options) {
if
(
url
.
substr
(
0
,
2
)
===
'./'
)
{
url
=
url
.
substr
(
2
);
}
if
(
url
.
substr
(
0
,
3
)
===
'../'
)
{
url
=
url
.
substr
(
3
);
}
var
arrUrl
=
options
.
url
.
split
(
'/'
);
arrUrl
[
arrUrl
.
length
-
1
]
=
url
;
url
=
arrUrl
.
join
(
'/'
);
...
...
package.json
View file @
b3edf85a
{
"name"
:
"
z-almighty-parser-core
"
,
"version"
:
"1.
0.6
"
,
"version"
:
"1.
1.2
"
,
"description"
:
"crawler prser core"
,
"main"
:
"index.js"
,
"scripts"
:
{
...
...
@@ -22,6 +22,7 @@
"
opencc
"
:
"^1.0.5"
,
"
request
"
:
"^2.81.0"
,
"
xmldom
"
:
"^0.1.27"
,
"
xpath
"
:
"0.0.24"
"
xpath
"
:
"0.0.24"
,
"
xss
"
:
"^0.3.3"
}
}
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