Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EduSpider
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
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
viitto
EduSpider
Commits
98ac668e
Commit
98ac668e
authored
Jun 02, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
03f477cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
SchoolHttpHelper.cs
EduSpider.Utility/SchoolHttpHelper.cs
+1
-2
Program.cs
EduSpider/Program.cs
+3
-2
SchoolCourseManager.cs
EduSpider/Spiders/SchoolHouseKeeper/SchoolCourseManager.cs
+11
-2
No files found.
EduSpider.Utility/SchoolHttpHelper.cs
View file @
98ac668e
...
@@ -27,6 +27,7 @@ namespace EduSpider.Utility
...
@@ -27,6 +27,7 @@ namespace EduSpider.Utility
AutomaticDecompression
=
DecompressionMethods
.
GZip
,
AutomaticDecompression
=
DecompressionMethods
.
GZip
,
ClientCertificateOptions
=
ClientCertificateOption
.
Automatic
ClientCertificateOptions
=
ClientCertificateOption
.
Automatic
};
};
var
http
=
new
HttpClient
(
handler
);
var
http
=
new
HttpClient
(
handler
);
GenerateHttpHeader
(
ref
http
);
GenerateHttpHeader
(
ref
http
);
return
http
;
return
http
;
...
@@ -42,7 +43,6 @@ namespace EduSpider.Utility
...
@@ -42,7 +43,6 @@ namespace EduSpider.Utility
http
.
DefaultRequestHeaders
.
Add
(
"Accept"
,
"*/*"
);
http
.
DefaultRequestHeaders
.
Add
(
"Accept"
,
"*/*"
);
http
.
DefaultRequestHeaders
.
Add
(
"Accept-Encoding"
,
"gzip, deflate, br"
);
http
.
DefaultRequestHeaders
.
Add
(
"Accept-Encoding"
,
"gzip, deflate, br"
);
http
.
DefaultRequestHeaders
.
Add
(
"Accept-Language"
,
"zh-CN,zh;q=0.9"
);
http
.
DefaultRequestHeaders
.
Add
(
"Accept-Language"
,
"zh-CN,zh;q=0.9"
);
//http.DefaultRequestHeaders.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
http
.
DefaultRequestHeaders
.
Add
(
"Cache-Control"
,
"no-cache"
);
http
.
DefaultRequestHeaders
.
Add
(
"Cache-Control"
,
"no-cache"
);
http
.
DefaultRequestHeaders
.
Add
(
"Origin"
,
"https://tms11.xiaogj.com"
);
http
.
DefaultRequestHeaders
.
Add
(
"Origin"
,
"https://tms11.xiaogj.com"
);
http
.
DefaultRequestHeaders
.
Add
(
"Pragma"
,
"no-cache"
);
http
.
DefaultRequestHeaders
.
Add
(
"Pragma"
,
"no-cache"
);
...
@@ -69,7 +69,6 @@ namespace EduSpider.Utility
...
@@ -69,7 +69,6 @@ namespace EduSpider.Utility
{
{
var
uri
=
new
Uri
(
"https://tms11.xiaogj.com"
);
var
uri
=
new
Uri
(
"https://tms11.xiaogj.com"
);
var
cc
=
new
CookieContainer
();
var
cc
=
new
CookieContainer
();
foreach
(
var
str
in
cookieStr
.
Split
(
';'
))
foreach
(
var
str
in
cookieStr
.
Split
(
';'
))
{
{
cc
.
SetCookies
(
uri
,
str
);
cc
.
SetCookies
(
uri
,
str
);
...
...
EduSpider/Program.cs
View file @
98ac668e
using
System
;
using
EduSpider.Spiders.SchoolHouseKeeper
;
using
System
;
using
TicketSpider.Spiders.ClassInRule
;
using
TicketSpider.Spiders.ClassInRule
;
namespace
EduSpider
namespace
EduSpider
...
@@ -12,7 +13,7 @@ namespace EduSpider
...
@@ -12,7 +13,7 @@ namespace EduSpider
// ClassInFlow.StartAsync();
// ClassInFlow.StartAsync();
//校管家数据
//校管家数据
//
SchoolTaskHelper.RunTask();
SchoolTaskHelper
.
RunTask
();
Console
.
ReadLine
();
Console
.
ReadLine
();
...
...
EduSpider/Spiders/SchoolHouseKeeper/SchoolCourseManager.cs
View file @
98ac668e
...
@@ -27,7 +27,7 @@ namespace EduSpider.Spiders.SchoolHouseKeeper
...
@@ -27,7 +27,7 @@ namespace EduSpider.Spiders.SchoolHouseKeeper
/// <summary>
/// <summary>
/// 获取课程列表
/// 获取课程列表
/// </summary>
/// </summary>
public
static
void
RunCourse
(
string
cookie
)
public
static
async
void
RunCourse
(
string
cookie
)
{
{
var
pageModel
=
new
PageModel
var
pageModel
=
new
PageModel
{
{
...
@@ -36,7 +36,16 @@ namespace EduSpider.Spiders.SchoolHouseKeeper
...
@@ -36,7 +36,16 @@ namespace EduSpider.Spiders.SchoolHouseKeeper
};
};
int
pageCount
;
int
pageCount
;
string
url
=
"https://tms11.xiaogj.com/api/Shift/Query"
;
string
url
=
"https://tms11.xiaogj.com/api/Shift/Query"
;
string
result
=
Utility
.
SchoolHttpHelper
.
HttpPost
(
url
,
VTX
.
FW
.
Helper
.
JsonHelper
.
Serialize
(
pageModel
),
"application/json"
,
cookie
);
var
request
=
Utility
.
SchoolHttpHelper
.
GenerateHttp
(
cookie
);
string
query
=
string
.
Format
(
"PageIndex=1&PageSize=10"
);
var
content
=
new
StringContent
(
VTX
.
FW
.
Helper
.
JsonHelper
.
Serialize
(
pageModel
),
System
.
Text
.
Encoding
.
GetEncoding
(
"UTF-8"
),
"application/json"
);
var
response
=
await
request
.
PostAsync
(
url
,
content
);
var
result12
=
response
.
Content
.
ReadAsStringAsync
().
Result
;
Console
.
WriteLine
(
"111"
+
result12
);
string
result
=
""
;
//result = Utility.SchoolHttpHelper.HttpPost(url, VTX.FW.Helper.JsonHelper.Serialize(pageModel), "application/json", cookie); ;
List
<
SchoolCourseItem
>
list
=
new
List
<
SchoolCourseItem
>();
List
<
SchoolCourseItem
>
list
=
new
List
<
SchoolCourseItem
>();
if
(!
string
.
IsNullOrEmpty
(
result
))
if
(!
string
.
IsNullOrEmpty
(
result
))
{
{
...
...
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