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
93684ded
Commit
93684ded
authored
Dec 04, 2021
by
Deokhyun Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
자동차 출력 완성
parent
7d95a5eb
Pipeline
#2110
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
Main.java
src/Main.java
+9
-11
No files found.
src/Main.java
View file @
93684ded
...
...
@@ -12,21 +12,19 @@ import org.jsoup.select.Elements;
public
class
Main
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
// 멜로 100 차트
System
.
out
.
println
(
"
멜론 100
출력"
);
System
.
out
.
println
(
"
다음 자동차
출력"
);
Scanner
sc
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"검색어: "
);
String
str
=
sc
.
next
();
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 str = sc.next();
// 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://auto.daum.net/news"
;
Document
doc
=
Jsoup
.
connect
(
URL
).
get
();
Elements
elem
=
doc
.
select
(
"div[class=\"
group_news
\"]"
);
Elements
elem
=
doc
.
select
(
"div[class=\"
cont_thumb
\"]"
);
for
(
Element
e
:
elem
.
select
(
"a"
))
{
if
(
e
.
className
().
equals
(
"news_tit"
))
{
System
.
out
.
println
(
e
.
text
());
// continue;
}
for
(
Element
e
:
elem
)
{
System
.
out
.
println
(
e
.
text
());
}
}
...
...
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