Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Crawling Java
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
Deokhyun Lee
Crawling Java
Commits
4c618746
Commit
4c618746
authored
Dec 04, 2021
by
Deokhyun Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added car news
parent
93684ded
Pipeline
#2111
failed with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Main.java
src/Main.java
+5
-5
No files found.
src/Main.java
View file @
4c618746
...
@@ -14,17 +14,17 @@ public class Main{
...
@@ -14,17 +14,17 @@ public class Main{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
System
.
out
.
println
(
"다음 자동차 출력"
);
System
.
out
.
println
(
"다음 자동차 출력"
);
Scanner
sc
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"검색어: "
);
// String str = sc.next();
// String str = sc.next();
// String text = URLEncoder.encode(str, "UTF-8");
// String text = URLEncoder.encode(str, "UTF-8");
// String URL = "https://search.naver.com/search.naver?query=" + text + "&where=news&ie=utf8&sm=nws_hty";
// String URL = "https://search.naver.com/search.naver?query=" + text + "&where=news&ie=utf8&sm=nws_hty";
String
URL
=
"https://auto.daum.net/news"
;
String
URL
=
"https://auto.daum.net/news"
;
Document
doc
=
Jsoup
.
connect
(
URL
).
get
();
Document
doc
=
Jsoup
.
connect
(
URL
).
get
();
Elements
elem
=
doc
.
select
(
"div[class=\"cont_thumb\"]"
);
Elements
trendingNews
=
doc
.
select
(
"div[class=\"cont_thumb\"]"
);
for
(
Element
e
:
elem
)
{
System
.
out
.
println
(
"주요 자동차 뉴스 출력"
);
System
.
out
.
println
(
e
.
text
());
for
(
Element
news
:
trendingNews
){
System
.
out
.
println
(
news
.
text
()
+
"\n"
);
}
}
}
}
...
...
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