본문 바로가기

[입문] 데이터 사이언스? 그게 뭔가요?

[뉴스 정보] 조금 진지한 크롤링, selenium / beautifulsoup

# 마치 사람이 접속하는 것 처럼 브라우저로 서버에 정보를 요청하는 seleuium
# 딕셔너리처럼 타고타고 들어가기에는 너무나도 복잡할 때 사용하는 bs4
!pip install selenium bs4
Requirement already satisfied: selenium in c:\users\one\appdata\local\continuum\anaconda3\lib\site-packages (3.141.0)
Collecting bs4
  Downloading https://files.pythonhosted.org/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gz
Requirement already satisfied: urllib3 in c:\users\one\appdata\local\continuum\anaconda3\lib\site-packages (from selenium) (1.24.2)
Requirement already satisfied: beautifulsoup4 in c:\users\one\appdata\local\continuum\anaconda3\lib\site-packages (from bs4) (4.7.1)
Requirement already satisfied: soupsieve>=1.2 in c:\users\one\appdata\local\continuum\anaconda3\lib\site-packages (from beautifulsoup4->bs4) (1.8)
Building wheels for collected packages: bs4
  Building wheel for bs4 (setup.py): started
  Building wheel for bs4 (setup.py): finished with status 'done'
  Stored in directory: C:\Users\one\AppData\Local\pip\Cache\wheels\a0\b0\b2\4f80b9456b87abedbc0bf2d52235414c3467d8889be38dd472
Successfully built bs4
Installing collected packages: bs4
Successfully installed bs4-0.0.1
# selenuim 의 webdriver 를 사용할 예정입니다.
from selenium import webdriver
from bs4 import BeautifulSoup as bs
# 네이버 검색 -> 뉴스 들어가서 RSS 가 아닌, 웹 주소 붙여넣기
# 이 주소는, 브라우저가 직접 들어갈 주소를 의미합니다.

url = 'https://search.naver.com/search.naver?sm=tab_hty.top&where=news&query=%EC%82%BC%EC%84%B1+%EB%B0%98%EB%8F%84%EC%B2%B4&oquery=%EC%82%BC%EC%84%B1+%EB%B0%98%EB%8F%84%EC%B2%B4&tqi=USlkowp0Jy0ssSA7bylssssstTs-243856'
# 우리가 사용할 브라우저는 크롬이고, webdriver.Chrome 이 크롬을 구동시켜줍니다.
# 이 안에 chromedriver.exe 를 넣어주면 이 파일이 크롬이고, 이것을 구동시켜라 라는 의미입니다.
driver = webdriver.Chrome('chromedriver.exe')

# 해당 주소의 서버에 get 방식의 요청을 보냅니다.
# 여기까지의 코드는, 크롬 창이 열리고 해당 url 에 접속하기까지 입니다.
driver.get(url)

# driver.page_source 는 서버에서 받아온 결과를 문자열 형태로 파이썬으로 가져오는 것입니다.
# 크롬에서 마우스 우클릭 -> 페이지 소스 보기로 나오는 결과와 동일합니다.
page = driver.page_source
page
# 메모장 utf-8 형식 html 으로 저장 후 열어보기
# 결국 서버에서 우리에게 주는 응답은 문자열 형태이고, 그래서 이를 html 확장자로 저장해서
# 크롬이나 익스플로러 같은 브라우저에서 열게되면 똑같은 결과가 나오게 됩니다.
# 이 결과를 xmltodict 의 경우와 마찬가지로
# 파이썬에서 인지할 수 있게 parsing 해주는 코드는
# BeautifulSoup 를 사용하면 다음과 같습니다.
# parsing 한 것을 step_01 이라고 해 줍니다.
step_01 = bs(page, 'html.parser')
# 뉴스의 제목이나 내용 등등... 우리가 원하는 모든 것들은
# ul 태그에서 type01 클래스로 묶여있는 공간 안에 있습니다.
# 이를 찾아주는 기능은 .find() 이고, 결과를 step_02 에 저장해 줍니다.
step_02 = step_01.find('ul', class_ = "type01")
# 변수 이름으로 내용을 조회하면 아래와 같이 한 눈에 보기 어려운 것이 나옵니다.
# 다 볼 필요가 없고, 처음 시작하는 부분만 확인하면 됩니다.
# ul 태그의 type_01 클래스를 잘 가져왔음을 확인합니다.
step_02
<ul class="type01"> <li id="sp_nws1"> <div class="thumb"><a class="sp_thmb thmb80" href="http://biz.chosun.com/site/data/html_dir/2019/08/21/2019082100788.html" onclick="return goOtherCR(this, 'a=nws*h.img&amp;r=1&amp;i=88127058_000000000000000000441302&amp;g=366.0000441302&amp;u='+urlencode(this.href));" target="_blank"><img alt="길어지는 메모리 보릿" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F366%2F2019%2F08%2F21%2F441302.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_title" href="http://biz.chosun.com/site/data/html_dir/2019/08/21/2019082100788.html" onclick="return goOtherCR(this, 'a=nws*h.tit&amp;r=1&amp;i=88127058_000000000000000000441302&amp;g=366.0000441302&amp;u='+urlencode(this.href));" target="_blank" title="길어지는 메모리 보릿고개…인텔, 삼성 제치고 반도체 1위 다시 오를 듯">길어지는 메모리 보릿고개…인텔, <strong class="hl">삼성</strong> 제치고 <strong class="hl">반도체</strong> 1위 다시 오를 듯</a></dt> <dd class="txt_inline"><span class="_sp_each_source">조선비즈<i class="sprenew api_ico_pick">언론사 선정</i></span> <span class="bar"></span> 4시간 전 <span class="bar"></span> <a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=105&amp;oid=366&amp;aid=0000441302" onclick="return goOtherCR(this, 'a=nws*h.nav&amp;r=1&amp;i=88127058_000000000000000000441302&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> <div class="scial" id="sp_nws1_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws1');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*h.pplugin&amp;r=1&amp;i=88127058_000000000000000000441302&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>이 기간 <strong class="hl">삼성</strong>전자의 <strong class="hl">반도체</strong> 부문 매출액은 266억7100만달러(2위)로 33% 줄었고, SK하이닉스(115억5800만달러·4위), 마이크론(101억7500만달러·5위)도 각각 35%, 34% 감소했다. 반면 비메모리 <strong class="hl">반도체</strong>를 주력으로 하는 인텔의...</dd> <dd> <ul class="relation_lst"> <li> <span class="ico_bu"></span> <a href="https://news.joins.com/article/olink/23150242" onclick="return goOtherCR(this, 'a=nws*c.tit&amp;r=2&amp;i=880000F2_000000000000000002931201&amp;g=025.0002931201&amp;u='+urlencode(this.href));" target="_blank" title="삼성전자 반도체 매출 30% 급감…반도체 1위 자리도 인텔에 내줘"><strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 매출 30% 급감…<strong class="hl">반도체</strong> 1위 자리도 인텔에 내줘</a> <span class="txt_sinfo"> <span class="press" title="중앙일보">중앙일보</span> <span class="bar"></span> 3시간 전 <span class="bar"></span><a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=101&amp;oid=025&amp;aid=0002931201" onclick="return goOtherCR(this, 'a=nws*c.nav&amp;r=2&amp;i=880000F2_000000000000000002931201&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> </span> </li> </ul> </dd> </dl> </li> <li id="sp_nws3"> <div class="thumb"><a class="sp_thmb thmb80" href="http://www.newspim.com/news/view/20190820000103" onclick="return goOtherCR(this, 'a=nws*b.img&amp;r=3&amp;i=88000394_000000000000000001294728&amp;g=5002.0001294728&amp;u='+urlencode(this.href));" target="_blank"><img alt='"삼성전자 반도체 생산' class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F5002%2F2019%2F08%2F20%2F1294728.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_url _sp_each_title" href="http://www.newspim.com/news/view/20190820000103" onclick="return goOtherCR(this, 'a=nws*b.tit&amp;r=3&amp;i=88000394_000000000000000001294728&amp;g=5002.0001294728&amp;u='+urlencode(this.href));" target="_blank" title='"삼성전자 반도체 생산 차질 없다...핵심소재 9개월치 확보" - KB'>"<strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 생산 차질 없다...핵심소재 9개월치 확보" - KB</a></dt> <dd class="txt_inline"><span class="_sp_each_source">뉴스핌</span> <span class="bar"></span> 1일 전 <div class="scial" id="sp_nws3_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws3');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*b.pplugin&amp;r=3&amp;i=88000394_000000000000000001294728&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>일본의 수출규제 지속에도 불구하고 <strong class="hl">삼성</strong>전자의 <strong class="hl">반도체</strong> 생산차질 가능성이 낮아졌다는 전망이 나왔다. <strong class="hl">삼성</strong>전자가 9개월치 이상의 <strong class="hl">반도체</strong> 핵심소재 재고를 확보했고, 내년부턴 일부 핵심 소재 및 장비에 대해 국내...</dd> <dd> <ul class="relation_lst"> <li> <span class="ico_bu"></span> <a href="http://www.ekn.kr/news/article.html?no=448802" onclick="return goOtherCR(this, 'a=nws*d.tit&amp;r=4&amp;i=88102504_000000000000000000351166&amp;g=5133.0000351166&amp;u='+urlencode(this.href));" target="_blank" title='"일본 수출규제, 삼성전자 반도체 생산차질 가능성 낮아"-KB증권'>"일본 수출규제, <strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 생산차질 가능성 낮아"-KB증권</a> <span class="txt_sinfo"> <span class="press" title="에너지경제">에너지경제</span> <span class="bar"></span> 1일 전 </span> </li> <li> <span class="ico_bu"></span> <a href="http://www.etoday.co.kr/news/section/newsview.php?idxno=1789625" onclick="return goOtherCR(this, 'a=nws*d.tit&amp;r=5&amp;i=88000393_000000000000000001432463&amp;g=5003.0001432463&amp;u='+urlencode(this.href));" target="_blank" title="“일본 수출규제, 삼성전자 반도체 생산차질 가능성 낮아져”-KB증권">“일본 수출규제, <strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 생산차질 가능성 낮아져”-KB증권</a> <span class="txt_sinfo"> <span class="press" title="이투데이">이투데이</span> <span class="bar"></span> 1일 전 </span> </li> </ul> </dd> </dl> </li> <li id="sp_nws6"> <div class="thumb"><a class="sp_thmb thmb80" href="https://cnbc.sbs.co.kr/article_hub/10000952422?division=NAVER" onclick="return goOtherCR(this, 'a=nws*j.img&amp;r=6&amp;i=8811AD97_000000000000000000191636&amp;g=374.0000191636&amp;u='+urlencode(this.href));" target="_blank"><img alt="외교장관 회담 앞두고" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F374%2F2019%2F08%2F20%2F191636.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_play"></span><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_title" href="https://cnbc.sbs.co.kr/article_hub/10000952422?division=NAVER" onclick="return goOtherCR(this, 'a=nws*j.tit&amp;r=6&amp;i=8811AD97_000000000000000000191636&amp;g=374.0000191636&amp;u='+urlencode(this.href));" target="_blank" title="외교장관 회담 앞두고…日, 삼성에 반도체 소재 수출허가">외교장관 회담 앞두고…日, <strong class="hl">삼성</strong>에 <strong class="hl">반도체</strong> 소재 수출허가</a></dt> <dd class="txt_inline"><span class="_sp_each_source">SBS CNBC<i class="sprenew api_ico_pick">언론사 선정</i></span> <span class="bar"></span> 1일 전 <span class="bar"></span> <a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=101&amp;oid=374&amp;aid=0000191636" onclick="return goOtherCR(this, 'a=nws*j.nav&amp;r=6&amp;i=8811AD97_000000000000000000191636&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> <div class="scial" id="sp_nws6_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws6');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*j.pplugin&amp;r=6&amp;i=8811AD97_000000000000000000191636&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>일본 기업이 <strong class="hl">삼성</strong>전자에 극자외선 EUV용 포토레지스트를 수출할 수 있게 된 건데, 이게 차세대 시스템 <strong class="hl">반도체</strong> 생산에 필수 소재입니다. 일본이 이번에 허가한 양은 6개월치이고, 지난 7일 허가됐던 3개월치를 합하면...</dd> </dl> </li> <li id="sp_nws7"> <dl> <dt><a class="_sp_each_url _sp_each_title" href="http://www.nspna.com/news/?mode=view&amp;newsid=378341" onclick="return goOtherCR(this, 'a=nws*f.tit&amp;r=7&amp;i=880003F1_000000000000000000355584&amp;g=5025.0000355584&amp;u='+urlencode(this.href));" target="_blank" title="[특징주]알파홀딩스, ‘삼성전자 반도체 SAFE ’ 부각+흑자 가능성에 상승세">[특징주]알파홀딩스, ‘<strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> SAFE ’ 부각+흑자 가능성에 상승세</a></dt> <dd class="txt_inline"><span class="_sp_each_source">NSP통신</span> <span class="bar"></span> 2시간 전 <div class="scial" id="sp_nws7_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws7');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*f.pplugin&amp;r=7&amp;i=880003F1_000000000000000000355584&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>유일하게 <strong class="hl">삼성</strong>전자 시스템<strong class="hl">반도체</strong> 파트너사 선정...올 흑자 가능성 높이 박정섭 기자, 알파홀딩스(117670)가 ‘<strong class="hl">삼성</strong>전자의 국내 유일 시스템<strong class="hl">반도체</strong> SAFE 파트너 부각‘과 함께 올 실적의 흑자전환 가능성이...</dd> </dl> </li> <li id="sp_nws8"> <div class="thumb"><a class="sp_thmb thmb80" href="http://www.dtoday.co.kr/news/articleView.html?idxno=324630" onclick="return goOtherCR(this, 'a=nws*f.img&amp;r=8&amp;i=881831df_000000000000000000056088&amp;g=5582.0000056088&amp;u='+urlencode(this.href));" target="_blank"><img alt="전매 제한 없는 ‘평택" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F5582%2F2019%2F08%2F21%2F56088.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_url _sp_each_title" href="http://www.dtoday.co.kr/news/articleView.html?idxno=324630" onclick="return goOtherCR(this, 'a=nws*f.tit&amp;r=8&amp;i=881831df_000000000000000000056088&amp;g=5582.0000056088&amp;u='+urlencode(this.href));" target="_blank" title="전매 제한 없는 '평택 고덕 코오롱 하늘채 시그니처' 아파트, 삼성반도체 투자로 시너지 효과 기대">전매 제한 없는 '평택 고덕 코오롱 하늘채 시그니처' 아파트, <strong class="hl">삼성반도체</strong> 투자...</a></dt> <dd class="txt_inline"><span class="_sp_each_source">일간투데이</span> <span class="bar"></span> 24분 전 <div class="scial" id="sp_nws8_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws8');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*f.pplugin&amp;r=8&amp;i=881831df_000000000000000000056088&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd><strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 공장 및 부지와 인접한 입지 조건 덕분에 향후 시세 차익이 두드러질 것으로 기대를 모으고 있다. 따라서 평택 내 고덕 코오롱하늘채 시그니처를 주목하는 광역 투자자 사례가 늘고 있다. 여기에 우수한...</dd> </dl> </li> <li id="sp_nws9"> <div class="thumb"><a class="sp_thmb thmb80" href="http://www.businesspost.co.kr/BP?command=article_view&amp;num=140163" onclick="return goOtherCR(this, 'a=nws*b.img&amp;r=9&amp;i=88155e5a_000000000000000000127434&amp;g=5374.0000127434&amp;u='+urlencode(this.href));" target="_blank"><img alt="일본에서 반도체 핵심" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F5374%2F2019%2F08%2F20%2F127434.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_url _sp_each_title" href="http://www.businesspost.co.kr/BP?command=article_view&amp;num=140163" onclick="return goOtherCR(this, 'a=nws*b.tit&amp;r=9&amp;i=88155e5a_000000000000000000127434&amp;g=5374.0000127434&amp;u='+urlencode(this.href));" target="_blank" title="일본에서 반도체 핵심소재 수출 또 허가, 삼성전자 6개월치 물량 확보">일본에서 <strong class="hl">반도체</strong> 핵심소재 수출 또 허가, <strong class="hl">삼성</strong>전자 6개월치 물량 확보</a></dt> <dd class="txt_inline"><span class="_sp_each_source">비즈니스포스트</span> <span class="bar"></span> 1일 전 <div class="scial" id="sp_nws9_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws9');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*b.pplugin&amp;r=9&amp;i=88155e5a_000000000000000000127434&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd><strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 공장 내부. 일본 정부는 규제 발표 한 달 뒤인 8월 초 포토레지스트의 수출을 처음 허가한 데 이어 두 번째로 수출을 허가했다. 이번에 허가한 물량은 약 6개월분인 것으로 전해졌다. 일본 정부는 7월부터...</dd> <dd> <ul class="relation_lst"> <li> <span class="ico_bu"></span> <a href="http://www.greened.kr/news/articleView.html?idxno=209100" onclick="return goOtherCR(this, 'a=nws*d.tit&amp;r=10&amp;i=8817ca90_000000000000000000072703&amp;g=5499.0000072703&amp;u='+urlencode(this.href));" target="_blank" title="[한일 경제전쟁] 삼성전자, 반도체 핵심소재 '포토레지스트' 9개월치 재고 확보...일본, 두번째 수출 허용">[한일 경제전쟁] <strong class="hl">삼성</strong>전자, <strong class="hl">반도체</strong> 핵심소재 '포토레지스트' 9개월치 재고 확...</a> <span class="txt_sinfo"> <span class="press" title="녹색경제신문">녹색경제신문</span> <span class="bar"></span> 22시간 전 </span> </li> </ul> </dd> </dl> </li> <li id="sp_nws11"> <div class="thumb"><a class="sp_thmb thmb80" href="http://www.newsway.co.kr/news/view?tp=1&amp;ud=2019082016553150067" onclick="return goOtherCR(this, 'a=nws*f.img&amp;r=11&amp;i=8813C2E6_000000000000000000583851&amp;g=5270.0000583851&amp;u='+urlencode(this.href));" target="_blank"><img alt="이재용 부회장, 반도체" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F5270%2F2019%2F08%2F20%2F583851.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_url _sp_each_title" href="http://www.newsway.co.kr/news/view?tp=1&amp;ud=2019082016553150067" onclick="return goOtherCR(this, 'a=nws*f.tit&amp;r=11&amp;i=8813C2E6_000000000000000000583851&amp;g=5270.0000583851&amp;u='+urlencode(this.href));" target="_blank" title="이재용 부회장, 반도체·가전 이어 인재양성까지…잇따른 현장경영">이재용 부회장, <strong class="hl">반도체</strong>·가전 이어 인재양성까지…잇따른 현장경영</a></dt> <dd class="txt_inline"><span class="_sp_each_source">뉴스웨이</span> <span class="bar"></span> 22시간 전 <div class="scial" id="sp_nws11_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws11');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*f.pplugin&amp;r=11&amp;i=8813C2E6_000000000000000000583851&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>온양 사업장은 <strong class="hl">반도체</strong> 후공정을 담당하는 곳으로 차세대 패키지 연구개발 중심 생산단지다며 평택사업장은 <strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 사업의 핵심 생산 기지다. 이 부회장이 이날 찾은 광주 교육센터는 약 700㎡ 규모에 최첨단...</dd> </dl> </li> <li id="sp_nws12"> <div class="thumb"><a class="sp_thmb thmb80" href="https://www.nocutnews.co.kr/news/5200722" onclick="return goOtherCR(this, 'a=nws*e.img&amp;r=12&amp;i=88000112_000000000000000003261339&amp;g=079.0003261339&amp;u='+urlencode(this.href));" target="_blank"><img alt="[영상]백군기 용인시장" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F079%2F2019%2F08%2F21%2F3261339.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_title" href="https://www.nocutnews.co.kr/news/5200722" onclick="return goOtherCR(this, 'a=nws*e.tit&amp;r=12&amp;i=88000112_000000000000000003261339&amp;g=079.0003261339&amp;u='+urlencode(this.href));" target="_blank" title='[영상]백군기 용인시장 "용인을 반도체 소재 국산화의 전진기지로 삼겠다"'>[영상]백군기 용인시장 "용인을 <strong class="hl">반도체</strong> 소재 국산화의 전진기지로 삼겠다"</a></dt> <dd class="txt_inline"><span class="_sp_each_source">노컷뉴스</span> <span class="bar"></span> 9시간 전 <span class="bar"></span> <a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=102&amp;oid=079&amp;aid=0003261339" onclick="return goOtherCR(this, 'a=nws*e.nav&amp;r=12&amp;i=88000112_000000000000000003261339&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> <div class="scial" id="sp_nws12_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws12');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*e.pplugin&amp;r=12&amp;i=88000112_000000000000000003261339&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>백군기 용인시장은 처인구 원삼면 일대에 유치한 120조원 규모의 SK하이닉스 <strong class="hl">반도체</strong> 클러스터와 기흥의 <strong class="hl">삼성반도체</strong>를 중심으로 세계적 <strong class="hl">반도체</strong> 중심도시를 꿈꾸고 있다. 이를 위해 최근 미국 실리콘밸리의 성공요인을 직접...</dd> </dl> </li> <li id="sp_nws13"> <div class="thumb"><a class="sp_thmb thmb80" href="http://www.hankookilbo.com/news/npath/201908191500372718?did=NA" onclick="return goOtherCR(this, 'a=nws*j.img&amp;r=13&amp;i=88156f75_000000000000000000414790&amp;g=469.0000414790&amp;u='+urlencode(this.href));" target="_blank"><img alt="[단독] 미래 먹거리부" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F469%2F2019%2F08%2F20%2F414790.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_title" href="http://www.hankookilbo.com/news/npath/201908191500372718?did=NA" onclick="return goOtherCR(this, 'a=nws*j.tit&amp;r=13&amp;i=88156f75_000000000000000000414790&amp;g=469.0000414790&amp;u='+urlencode(this.href));" target="_blank" title="[단독] 미래 먹거리부터… 삼성 ‘脫일본 1순위’는 시스템 반도체’">[단독] 미래 먹거리부터… <strong class="hl">삼성</strong> ‘脫일본 1순위’는 시스템 <strong class="hl">반도체</strong>’</a></dt> <dd class="txt_inline"><span class="_sp_each_source">한국일보<i class="sprenew api_ico_pick">언론사 선정</i></span> <span class="bar"></span> <span class="newspaper">6면 <img alt="TOP" height="9" src="https://ssl.pstatic.net/sstatic/search/img3/ico_top.gif" width="17"/></span> <span class="bar"></span> 1일 전 <span class="bar"></span> <a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=101&amp;oid=469&amp;aid=0000414790" onclick="return goOtherCR(this, 'a=nws*j.nav&amp;r=13&amp;i=88156f75_000000000000000000414790&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> <div class="scial" id="sp_nws13_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws13');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*j.pplugin&amp;r=13&amp;i=88156f75_000000000000000000414790&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>시스템 <strong class="hl">반도체</strong>는 <strong class="hl">삼성</strong>전자가 133조원을 투자해 2030년까지 글로벌 1위를 차지하겠다는 계획을 밝힌 분야다. <strong class="hl">삼성</strong>이 미래 먹거리로 지목한 시스템 <strong class="hl">반도체</strong>의 성장이 향후 또 다른 정치 외교적 문제로 차질이 빚어지는 걸...</dd> </dl> </li> <li id="sp_nws14"> <div class="thumb"><a class="sp_thmb thmb80" href="http://www.edaily.co.kr/news/newspath.asp?newsid=03647366622589288" onclick="return goOtherCR(this, 'a=nws*e.img&amp;r=14&amp;i=880000E7_000000000000000004449588&amp;g=018.0004449588&amp;u='+urlencode(this.href));" target="_blank"><img alt="日수출 규제도 못 막는" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F018%2F2019%2F08%2F20%2F4449588.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_title" href="http://www.edaily.co.kr/news/newspath.asp?newsid=03647366622589288" onclick="return goOtherCR(this, 'a=nws*e.tit&amp;r=14&amp;i=880000E7_000000000000000004449588&amp;g=018.0004449588&amp;u='+urlencode(this.href));" target="_blank" title="日수출 규제도 못 막는 `삼성 시스템반도체`…“흔들림없이 간다”">日수출 규제도 못 막는 `<strong class="hl">삼성</strong> 시스템<strong class="hl">반도체</strong>`…“흔들림없이 간다”</a></dt> <dd class="txt_inline"><span class="_sp_each_source">이데일리</span> <span class="bar"></span> <span class="newspaper">A14면 <img alt="TOP" height="9" src="https://ssl.pstatic.net/sstatic/search/img3/ico_top.gif" width="17"/></span> <span class="bar"></span> 22시간 전 <span class="bar"></span> <a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=101&amp;oid=018&amp;aid=0004449588" onclick="return goOtherCR(this, 'a=nws*e.nav&amp;r=14&amp;i=880000E7_000000000000000004449588&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> <div class="scial" id="sp_nws14_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws14');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*e.pplugin&amp;r=14&amp;i=880000E7_000000000000000004449588&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>- 日 EUV용 PR 수출 두번째 허용..9개월치 확보 - <strong class="hl">삼성</strong>, 내달 일본 파운드리 포럼 예정대로 개최 - 이재용 부회장, 시스템<strong class="hl">반도체</strong> 현장 행보 계속 <strong class="hl">삼성</strong>전자 화성캠퍼스 EUV 라인 전경. (사진=<strong class="hl">삼성</strong>전자)[이데일리 양희동...</dd> </dl> </li> </ul>
# ul 태그의 type_01 클래스 안에는 뉴스 하나하나마다 li태그로 감싸져 있습니다.
# .fildAll() 는 찾고자 하는 것을 전부 찾아서 리스트로 만들어 줍니다.
# 지금은 step_02 단계에서 li 태그를 전부 찾아볼 겁니다.
step_03 = step_02.findAll('li')
step_03
[<li id="sp_nws1"> <div class="thumb"><a class="sp_thmb thmb80" href="http://biz.chosun.com/site/data/html_dir/2019/08/21/2019082100788.html" onclick="return goOtherCR(this, 'a=nws*h.img&amp;r=1&amp;i=88127058_000000000000000000441302&amp;g=366.0000441302&amp;u='+urlencode(this.href));" target="_blank"><img alt="길어지는 메모리 보릿" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F366%2F2019%2F08%2F21%2F441302.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_title" href="http://biz.chosun.com/site/data/html_dir/2019/08/21/2019082100788.html" onclick="return goOtherCR(this, 'a=nws*h.tit&amp;r=1&amp;i=88127058_000000000000000000441302&amp;g=366.0000441302&amp;u='+urlencode(this.href));" target="_blank" title="길어지는 메모리 보릿고개…인텔, 삼성 제치고 반도체 1위 다시 오를 듯">길어지는 메모리 보릿고개…인텔, <strong class="hl">삼성</strong> 제치고 <strong class="hl">반도체</strong> 1위 다시 오를 듯</a></dt> <dd class="txt_inline"><span class="_sp_each_source">조선비즈<i class="sprenew api_ico_pick">언론사 선정</i></span> <span class="bar"></span> 4시간 전 <span class="bar"></span> <a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=105&amp;oid=366&amp;aid=0000441302" onclick="return goOtherCR(this, 'a=nws*h.nav&amp;r=1&amp;i=88127058_000000000000000000441302&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> <div class="scial" id="sp_nws1_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws1');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*h.pplugin&amp;r=1&amp;i=88127058_000000000000000000441302&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>이 기간 <strong class="hl">삼성</strong>전자의 <strong class="hl">반도체</strong> 부문 매출액은 266억7100만달러(2위)로 33% 줄었고, SK하이닉스(115억5800만달러·4위), 마이크론(101억7500만달러·5위)도 각각 35%, 34% 감소했다. 반면 비메모리 <strong class="hl">반도체</strong>를 주력으로 하는 인텔의...</dd> <dd> <ul class="relation_lst"> <li> <span class="ico_bu"></span> <a href="https://news.joins.com/article/olink/23150242" onclick="return goOtherCR(this, 'a=nws*c.tit&amp;r=2&amp;i=880000F2_000000000000000002931201&amp;g=025.0002931201&amp;u='+urlencode(this.href));" target="_blank" title="삼성전자 반도체 매출 30% 급감…반도체 1위 자리도 인텔에 내줘"><strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 매출 30% 급감…<strong class="hl">반도체</strong> 1위 자리도 인텔에 내줘</a> <span class="txt_sinfo"> <span class="press" title="중앙일보">중앙일보</span> <span class="bar"></span> 3시간 전 <span class="bar"></span><a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=101&amp;oid=025&amp;aid=0002931201" onclick="return goOtherCR(this, 'a=nws*c.nav&amp;r=2&amp;i=880000F2_000000000000000002931201&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> </span> </li> </ul> </dd> </dl> </li>,
 <li> <span class="ico_bu"></span> <a href="https://news.joins.com/article/olink/23150242" onclick="return goOtherCR(this, 'a=nws*c.tit&amp;r=2&amp;i=880000F2_000000000000000002931201&amp;g=025.0002931201&amp;u='+urlencode(this.href));" target="_blank" title="삼성전자 반도체 매출 30% 급감…반도체 1위 자리도 인텔에 내줘"><strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 매출 30% 급감…<strong class="hl">반도체</strong> 1위 자리도 인텔에 내줘</a> <span class="txt_sinfo"> <span class="press" title="중앙일보">중앙일보</span> <span class="bar"></span> 3시간 전 <span class="bar"></span><a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=101&amp;oid=025&amp;aid=0002931201" onclick="return goOtherCR(this, 'a=nws*c.nav&amp;r=2&amp;i=880000F2_000000000000000002931201&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> </span> </li>,
 <li id="sp_nws3"> <div class="thumb"><a class="sp_thmb thmb80" href="http://www.newspim.com/news/view/20190820000103" onclick="return goOtherCR(this, 'a=nws*b.img&amp;r=3&amp;i=88000394_000000000000000001294728&amp;g=5002.0001294728&amp;u='+urlencode(this.href));" target="_blank"><img alt='"삼성전자 반도체 생산' class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F5002%2F2019%2F08%2F20%2F1294728.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_url _sp_each_title" href="http://www.newspim.com/news/view/20190820000103" onclick="return goOtherCR(this, 'a=nws*b.tit&amp;r=3&amp;i=88000394_000000000000000001294728&amp;g=5002.0001294728&amp;u='+urlencode(this.href));" target="_blank" title='"삼성전자 반도체 생산 차질 없다...핵심소재 9개월치 확보" - KB'>"<strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 생산 차질 없다...핵심소재 9개월치 확보" - KB</a></dt> <dd class="txt_inline"><span class="_sp_each_source">뉴스핌</span> <span class="bar"></span> 1일 전 <div class="scial" id="sp_nws3_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws3');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*b.pplugin&amp;r=3&amp;i=88000394_000000000000000001294728&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>일본의 수출규제 지속에도 불구하고 <strong class="hl">삼성</strong>전자의 <strong class="hl">반도체</strong> 생산차질 가능성이 낮아졌다는 전망이 나왔다. <strong class="hl">삼성</strong>전자가 9개월치 이상의 <strong class="hl">반도체</strong> 핵심소재 재고를 확보했고, 내년부턴 일부 핵심 소재 및 장비에 대해 국내...</dd> <dd> <ul class="relation_lst"> <li> <span class="ico_bu"></span> <a href="http://www.ekn.kr/news/article.html?no=448802" onclick="return goOtherCR(this, 'a=nws*d.tit&amp;r=4&amp;i=88102504_000000000000000000351166&amp;g=5133.0000351166&amp;u='+urlencode(this.href));" target="_blank" title='"일본 수출규제, 삼성전자 반도체 생산차질 가능성 낮아"-KB증권'>"일본 수출규제, <strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 생산차질 가능성 낮아"-KB증권</a> <span class="txt_sinfo"> <span class="press" title="에너지경제">에너지경제</span> <span class="bar"></span> 1일 전 </span> </li> <li> <span class="ico_bu"></span> <a href="http://www.etoday.co.kr/news/section/newsview.php?idxno=1789625" onclick="return goOtherCR(this, 'a=nws*d.tit&amp;r=5&amp;i=88000393_000000000000000001432463&amp;g=5003.0001432463&amp;u='+urlencode(this.href));" target="_blank" title="“일본 수출규제, 삼성전자 반도체 생산차질 가능성 낮아져”-KB증권">“일본 수출규제, <strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 생산차질 가능성 낮아져”-KB증권</a> <span class="txt_sinfo"> <span class="press" title="이투데이">이투데이</span> <span class="bar"></span> 1일 전 </span> </li> </ul> </dd> </dl> </li>,
 <li> <span class="ico_bu"></span> <a href="http://www.ekn.kr/news/article.html?no=448802" onclick="return goOtherCR(this, 'a=nws*d.tit&amp;r=4&amp;i=88102504_000000000000000000351166&amp;g=5133.0000351166&amp;u='+urlencode(this.href));" target="_blank" title='"일본 수출규제, 삼성전자 반도체 생산차질 가능성 낮아"-KB증권'>"일본 수출규제, <strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 생산차질 가능성 낮아"-KB증권</a> <span class="txt_sinfo"> <span class="press" title="에너지경제">에너지경제</span> <span class="bar"></span> 1일 전 </span> </li>,
 <li> <span class="ico_bu"></span> <a href="http://www.etoday.co.kr/news/section/newsview.php?idxno=1789625" onclick="return goOtherCR(this, 'a=nws*d.tit&amp;r=5&amp;i=88000393_000000000000000001432463&amp;g=5003.0001432463&amp;u='+urlencode(this.href));" target="_blank" title="“일본 수출규제, 삼성전자 반도체 생산차질 가능성 낮아져”-KB증권">“일본 수출규제, <strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 생산차질 가능성 낮아져”-KB증권</a> <span class="txt_sinfo"> <span class="press" title="이투데이">이투데이</span> <span class="bar"></span> 1일 전 </span> </li>,
 <li id="sp_nws6"> <div class="thumb"><a class="sp_thmb thmb80" href="https://cnbc.sbs.co.kr/article_hub/10000952422?division=NAVER" onclick="return goOtherCR(this, 'a=nws*j.img&amp;r=6&amp;i=8811AD97_000000000000000000191636&amp;g=374.0000191636&amp;u='+urlencode(this.href));" target="_blank"><img alt="외교장관 회담 앞두고" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F374%2F2019%2F08%2F20%2F191636.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_play"></span><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_title" href="https://cnbc.sbs.co.kr/article_hub/10000952422?division=NAVER" onclick="return goOtherCR(this, 'a=nws*j.tit&amp;r=6&amp;i=8811AD97_000000000000000000191636&amp;g=374.0000191636&amp;u='+urlencode(this.href));" target="_blank" title="외교장관 회담 앞두고…日, 삼성에 반도체 소재 수출허가">외교장관 회담 앞두고…日, <strong class="hl">삼성</strong>에 <strong class="hl">반도체</strong> 소재 수출허가</a></dt> <dd class="txt_inline"><span class="_sp_each_source">SBS CNBC<i class="sprenew api_ico_pick">언론사 선정</i></span> <span class="bar"></span> 1일 전 <span class="bar"></span> <a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=101&amp;oid=374&amp;aid=0000191636" onclick="return goOtherCR(this, 'a=nws*j.nav&amp;r=6&amp;i=8811AD97_000000000000000000191636&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> <div class="scial" id="sp_nws6_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws6');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*j.pplugin&amp;r=6&amp;i=8811AD97_000000000000000000191636&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>일본 기업이 <strong class="hl">삼성</strong>전자에 극자외선 EUV용 포토레지스트를 수출할 수 있게 된 건데, 이게 차세대 시스템 <strong class="hl">반도체</strong> 생산에 필수 소재입니다. 일본이 이번에 허가한 양은 6개월치이고, 지난 7일 허가됐던 3개월치를 합하면...</dd> </dl> </li>,
 <li id="sp_nws7"> <dl> <dt><a class="_sp_each_url _sp_each_title" href="http://www.nspna.com/news/?mode=view&amp;newsid=378341" onclick="return goOtherCR(this, 'a=nws*f.tit&amp;r=7&amp;i=880003F1_000000000000000000355584&amp;g=5025.0000355584&amp;u='+urlencode(this.href));" target="_blank" title="[특징주]알파홀딩스, ‘삼성전자 반도체 SAFE ’ 부각+흑자 가능성에 상승세">[특징주]알파홀딩스, ‘<strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> SAFE ’ 부각+흑자 가능성에 상승세</a></dt> <dd class="txt_inline"><span class="_sp_each_source">NSP통신</span> <span class="bar"></span> 2시간 전 <div class="scial" id="sp_nws7_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws7');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*f.pplugin&amp;r=7&amp;i=880003F1_000000000000000000355584&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>유일하게 <strong class="hl">삼성</strong>전자 시스템<strong class="hl">반도체</strong> 파트너사 선정...올 흑자 가능성 높이 박정섭 기자, 알파홀딩스(117670)가 ‘<strong class="hl">삼성</strong>전자의 국내 유일 시스템<strong class="hl">반도체</strong> SAFE 파트너 부각‘과 함께 올 실적의 흑자전환 가능성이...</dd> </dl> </li>,
 <li id="sp_nws8"> <div class="thumb"><a class="sp_thmb thmb80" href="http://www.dtoday.co.kr/news/articleView.html?idxno=324630" onclick="return goOtherCR(this, 'a=nws*f.img&amp;r=8&amp;i=881831df_000000000000000000056088&amp;g=5582.0000056088&amp;u='+urlencode(this.href));" target="_blank"><img alt="전매 제한 없는 ‘평택" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F5582%2F2019%2F08%2F21%2F56088.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_url _sp_each_title" href="http://www.dtoday.co.kr/news/articleView.html?idxno=324630" onclick="return goOtherCR(this, 'a=nws*f.tit&amp;r=8&amp;i=881831df_000000000000000000056088&amp;g=5582.0000056088&amp;u='+urlencode(this.href));" target="_blank" title="전매 제한 없는 '평택 고덕 코오롱 하늘채 시그니처' 아파트, 삼성반도체 투자로 시너지 효과 기대">전매 제한 없는 '평택 고덕 코오롱 하늘채 시그니처' 아파트, <strong class="hl">삼성반도체</strong> 투자...</a></dt> <dd class="txt_inline"><span class="_sp_each_source">일간투데이</span> <span class="bar"></span> 24분 전 <div class="scial" id="sp_nws8_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws8');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*f.pplugin&amp;r=8&amp;i=881831df_000000000000000000056088&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd><strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 공장 및 부지와 인접한 입지 조건 덕분에 향후 시세 차익이 두드러질 것으로 기대를 모으고 있다. 따라서 평택 내 고덕 코오롱하늘채 시그니처를 주목하는 광역 투자자 사례가 늘고 있다. 여기에 우수한...</dd> </dl> </li>,
 <li id="sp_nws9"> <div class="thumb"><a class="sp_thmb thmb80" href="http://www.businesspost.co.kr/BP?command=article_view&amp;num=140163" onclick="return goOtherCR(this, 'a=nws*b.img&amp;r=9&amp;i=88155e5a_000000000000000000127434&amp;g=5374.0000127434&amp;u='+urlencode(this.href));" target="_blank"><img alt="일본에서 반도체 핵심" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F5374%2F2019%2F08%2F20%2F127434.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_url _sp_each_title" href="http://www.businesspost.co.kr/BP?command=article_view&amp;num=140163" onclick="return goOtherCR(this, 'a=nws*b.tit&amp;r=9&amp;i=88155e5a_000000000000000000127434&amp;g=5374.0000127434&amp;u='+urlencode(this.href));" target="_blank" title="일본에서 반도체 핵심소재 수출 또 허가, 삼성전자 6개월치 물량 확보">일본에서 <strong class="hl">반도체</strong> 핵심소재 수출 또 허가, <strong class="hl">삼성</strong>전자 6개월치 물량 확보</a></dt> <dd class="txt_inline"><span class="_sp_each_source">비즈니스포스트</span> <span class="bar"></span> 1일 전 <div class="scial" id="sp_nws9_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws9');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*b.pplugin&amp;r=9&amp;i=88155e5a_000000000000000000127434&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd><strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 공장 내부. 일본 정부는 규제 발표 한 달 뒤인 8월 초 포토레지스트의 수출을 처음 허가한 데 이어 두 번째로 수출을 허가했다. 이번에 허가한 물량은 약 6개월분인 것으로 전해졌다. 일본 정부는 7월부터...</dd> <dd> <ul class="relation_lst"> <li> <span class="ico_bu"></span> <a href="http://www.greened.kr/news/articleView.html?idxno=209100" onclick="return goOtherCR(this, 'a=nws*d.tit&amp;r=10&amp;i=8817ca90_000000000000000000072703&amp;g=5499.0000072703&amp;u='+urlencode(this.href));" target="_blank" title="[한일 경제전쟁] 삼성전자, 반도체 핵심소재 '포토레지스트' 9개월치 재고 확보...일본, 두번째 수출 허용">[한일 경제전쟁] <strong class="hl">삼성</strong>전자, <strong class="hl">반도체</strong> 핵심소재 '포토레지스트' 9개월치 재고 확...</a> <span class="txt_sinfo"> <span class="press" title="녹색경제신문">녹색경제신문</span> <span class="bar"></span> 22시간 전 </span> </li> </ul> </dd> </dl> </li>,
 <li> <span class="ico_bu"></span> <a href="http://www.greened.kr/news/articleView.html?idxno=209100" onclick="return goOtherCR(this, 'a=nws*d.tit&amp;r=10&amp;i=8817ca90_000000000000000000072703&amp;g=5499.0000072703&amp;u='+urlencode(this.href));" target="_blank" title="[한일 경제전쟁] 삼성전자, 반도체 핵심소재 '포토레지스트' 9개월치 재고 확보...일본, 두번째 수출 허용">[한일 경제전쟁] <strong class="hl">삼성</strong>전자, <strong class="hl">반도체</strong> 핵심소재 '포토레지스트' 9개월치 재고 확...</a> <span class="txt_sinfo"> <span class="press" title="녹색경제신문">녹색경제신문</span> <span class="bar"></span> 22시간 전 </span> </li>,
 <li id="sp_nws11"> <div class="thumb"><a class="sp_thmb thmb80" href="http://www.newsway.co.kr/news/view?tp=1&amp;ud=2019082016553150067" onclick="return goOtherCR(this, 'a=nws*f.img&amp;r=11&amp;i=8813C2E6_000000000000000000583851&amp;g=5270.0000583851&amp;u='+urlencode(this.href));" target="_blank"><img alt="이재용 부회장, 반도체" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F5270%2F2019%2F08%2F20%2F583851.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_url _sp_each_title" href="http://www.newsway.co.kr/news/view?tp=1&amp;ud=2019082016553150067" onclick="return goOtherCR(this, 'a=nws*f.tit&amp;r=11&amp;i=8813C2E6_000000000000000000583851&amp;g=5270.0000583851&amp;u='+urlencode(this.href));" target="_blank" title="이재용 부회장, 반도체·가전 이어 인재양성까지…잇따른 현장경영">이재용 부회장, <strong class="hl">반도체</strong>·가전 이어 인재양성까지…잇따른 현장경영</a></dt> <dd class="txt_inline"><span class="_sp_each_source">뉴스웨이</span> <span class="bar"></span> 22시간 전 <div class="scial" id="sp_nws11_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws11');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*f.pplugin&amp;r=11&amp;i=8813C2E6_000000000000000000583851&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>온양 사업장은 <strong class="hl">반도체</strong> 후공정을 담당하는 곳으로 차세대 패키지 연구개발 중심 생산단지다며 평택사업장은 <strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 사업의 핵심 생산 기지다. 이 부회장이 이날 찾은 광주 교육센터는 약 700㎡ 규모에 최첨단...</dd> </dl> </li>,
 <li id="sp_nws12"> <div class="thumb"><a class="sp_thmb thmb80" href="https://www.nocutnews.co.kr/news/5200722" onclick="return goOtherCR(this, 'a=nws*e.img&amp;r=12&amp;i=88000112_000000000000000003261339&amp;g=079.0003261339&amp;u='+urlencode(this.href));" target="_blank"><img alt="[영상]백군기 용인시장" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F079%2F2019%2F08%2F21%2F3261339.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_title" href="https://www.nocutnews.co.kr/news/5200722" onclick="return goOtherCR(this, 'a=nws*e.tit&amp;r=12&amp;i=88000112_000000000000000003261339&amp;g=079.0003261339&amp;u='+urlencode(this.href));" target="_blank" title='[영상]백군기 용인시장 "용인을 반도체 소재 국산화의 전진기지로 삼겠다"'>[영상]백군기 용인시장 "용인을 <strong class="hl">반도체</strong> 소재 국산화의 전진기지로 삼겠다"</a></dt> <dd class="txt_inline"><span class="_sp_each_source">노컷뉴스</span> <span class="bar"></span> 9시간 전 <span class="bar"></span> <a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=102&amp;oid=079&amp;aid=0003261339" onclick="return goOtherCR(this, 'a=nws*e.nav&amp;r=12&amp;i=88000112_000000000000000003261339&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> <div class="scial" id="sp_nws12_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws12');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*e.pplugin&amp;r=12&amp;i=88000112_000000000000000003261339&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>백군기 용인시장은 처인구 원삼면 일대에 유치한 120조원 규모의 SK하이닉스 <strong class="hl">반도체</strong> 클러스터와 기흥의 <strong class="hl">삼성반도체</strong>를 중심으로 세계적 <strong class="hl">반도체</strong> 중심도시를 꿈꾸고 있다. 이를 위해 최근 미국 실리콘밸리의 성공요인을 직접...</dd> </dl> </li>,
 <li id="sp_nws13"> <div class="thumb"><a class="sp_thmb thmb80" href="http://www.hankookilbo.com/news/npath/201908191500372718?did=NA" onclick="return goOtherCR(this, 'a=nws*j.img&amp;r=13&amp;i=88156f75_000000000000000000414790&amp;g=469.0000414790&amp;u='+urlencode(this.href));" target="_blank"><img alt="[단독] 미래 먹거리부" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F469%2F2019%2F08%2F20%2F414790.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_title" href="http://www.hankookilbo.com/news/npath/201908191500372718?did=NA" onclick="return goOtherCR(this, 'a=nws*j.tit&amp;r=13&amp;i=88156f75_000000000000000000414790&amp;g=469.0000414790&amp;u='+urlencode(this.href));" target="_blank" title="[단독] 미래 먹거리부터… 삼성 ‘脫일본 1순위’는 시스템 반도체’">[단독] 미래 먹거리부터… <strong class="hl">삼성</strong> ‘脫일본 1순위’는 시스템 <strong class="hl">반도체</strong>’</a></dt> <dd class="txt_inline"><span class="_sp_each_source">한국일보<i class="sprenew api_ico_pick">언론사 선정</i></span> <span class="bar"></span> <span class="newspaper">6면 <img alt="TOP" height="9" src="https://ssl.pstatic.net/sstatic/search/img3/ico_top.gif" width="17"/></span> <span class="bar"></span> 1일 전 <span class="bar"></span> <a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=101&amp;oid=469&amp;aid=0000414790" onclick="return goOtherCR(this, 'a=nws*j.nav&amp;r=13&amp;i=88156f75_000000000000000000414790&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> <div class="scial" id="sp_nws13_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws13');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*j.pplugin&amp;r=13&amp;i=88156f75_000000000000000000414790&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>시스템 <strong class="hl">반도체</strong>는 <strong class="hl">삼성</strong>전자가 133조원을 투자해 2030년까지 글로벌 1위를 차지하겠다는 계획을 밝힌 분야다. <strong class="hl">삼성</strong>이 미래 먹거리로 지목한 시스템 <strong class="hl">반도체</strong>의 성장이 향후 또 다른 정치 외교적 문제로 차질이 빚어지는 걸...</dd> </dl> </li>,
 <li id="sp_nws14"> <div class="thumb"><a class="sp_thmb thmb80" href="http://www.edaily.co.kr/news/newspath.asp?newsid=03647366622589288" onclick="return goOtherCR(this, 'a=nws*e.img&amp;r=14&amp;i=880000E7_000000000000000004449588&amp;g=018.0004449588&amp;u='+urlencode(this.href));" target="_blank"><img alt="日수출 규제도 못 막는" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F018%2F2019%2F08%2F20%2F4449588.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_title" href="http://www.edaily.co.kr/news/newspath.asp?newsid=03647366622589288" onclick="return goOtherCR(this, 'a=nws*e.tit&amp;r=14&amp;i=880000E7_000000000000000004449588&amp;g=018.0004449588&amp;u='+urlencode(this.href));" target="_blank" title="日수출 규제도 못 막는 `삼성 시스템반도체`…“흔들림없이 간다”">日수출 규제도 못 막는 `<strong class="hl">삼성</strong> 시스템<strong class="hl">반도체</strong>`…“흔들림없이 간다”</a></dt> <dd class="txt_inline"><span class="_sp_each_source">이데일리</span> <span class="bar"></span> <span class="newspaper">A14면 <img alt="TOP" height="9" src="https://ssl.pstatic.net/sstatic/search/img3/ico_top.gif" width="17"/></span> <span class="bar"></span> 22시간 전 <span class="bar"></span> <a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=101&amp;oid=018&amp;aid=0004449588" onclick="return goOtherCR(this, 'a=nws*e.nav&amp;r=14&amp;i=880000E7_000000000000000004449588&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> <div class="scial" id="sp_nws14_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws14');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*e.pplugin&amp;r=14&amp;i=880000E7_000000000000000004449588&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>- 日 EUV용 PR 수출 두번째 허용..9개월치 확보 - <strong class="hl">삼성</strong>, 내달 일본 파운드리 포럼 예정대로 개최 - 이재용 부회장, 시스템<strong class="hl">반도체</strong> 현장 행보 계속 <strong class="hl">삼성</strong>전자 화성캠퍼스 EUV 라인 전경. (사진=<strong class="hl">삼성</strong>전자)[이데일리 양희동...</dd> </dl> </li>]
# 리스트는 인덱스로 조회가 가능하므로, 0번째를 조회해 봅니다.
step_03[0]
<li id="sp_nws1"> <div class="thumb"><a class="sp_thmb thmb80" href="http://biz.chosun.com/site/data/html_dir/2019/08/21/2019082100788.html" onclick="return goOtherCR(this, 'a=nws*h.img&amp;r=1&amp;i=88127058_000000000000000000441302&amp;g=366.0000441302&amp;u='+urlencode(this.href));" target="_blank"><img alt="길어지는 메모리 보릿" class="" height="80" onerror="this.parentNode.style.display='none';" src="https://search.pstatic.net/common/?src=https%3A%2F%2Fimgnews.pstatic.net%2Fimage%2Forigin%2F366%2F2019%2F08%2F21%2F441302.jpg&amp;type=ofullfill80_80_q75_re2" width="80"/><span class="thmb_v"></span></a></div> <dl> <dt><a class="_sp_each_title" href="http://biz.chosun.com/site/data/html_dir/2019/08/21/2019082100788.html" onclick="return goOtherCR(this, 'a=nws*h.tit&amp;r=1&amp;i=88127058_000000000000000000441302&amp;g=366.0000441302&amp;u='+urlencode(this.href));" target="_blank" title="길어지는 메모리 보릿고개…인텔, 삼성 제치고 반도체 1위 다시 오를 듯">길어지는 메모리 보릿고개…인텔, <strong class="hl">삼성</strong> 제치고 <strong class="hl">반도체</strong> 1위 다시 오를 듯</a></dt> <dd class="txt_inline"><span class="_sp_each_source">조선비즈<i class="sprenew api_ico_pick">언론사 선정</i></span> <span class="bar"></span> 4시간 전 <span class="bar"></span> <a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=105&amp;oid=366&amp;aid=0000441302" onclick="return goOtherCR(this, 'a=nws*h.nav&amp;r=1&amp;i=88127058_000000000000000000441302&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> <div class="scial" id="sp_nws1_base"> <span class="bar"></span> <a class="bt_scial2 naver-splugin" data-oninitialize="splugin_oninitialize('sp_nws1');" data-style="unity-v2" href="#" onclick="goOtherTCR(this, 'a=nws*h.pplugin&amp;r=1&amp;i=88127058_000000000000000000441302&amp;u='+urlencode(this.href)); return false;">보내기</a> </div> </dd> <dd>이 기간 <strong class="hl">삼성</strong>전자의 <strong class="hl">반도체</strong> 부문 매출액은 266억7100만달러(2위)로 33% 줄었고, SK하이닉스(115억5800만달러·4위), 마이크론(101억7500만달러·5위)도 각각 35%, 34% 감소했다. 반면 비메모리 <strong class="hl">반도체</strong>를 주력으로 하는 인텔의...</dd> <dd> <ul class="relation_lst"> <li> <span class="ico_bu"></span> <a href="https://news.joins.com/article/olink/23150242" onclick="return goOtherCR(this, 'a=nws*c.tit&amp;r=2&amp;i=880000F2_000000000000000002931201&amp;g=025.0002931201&amp;u='+urlencode(this.href));" target="_blank" title="삼성전자 반도체 매출 30% 급감…반도체 1위 자리도 인텔에 내줘"><strong class="hl">삼성</strong>전자 <strong class="hl">반도체</strong> 매출 30% 급감…<strong class="hl">반도체</strong> 1위 자리도 인텔에 내줘</a> <span class="txt_sinfo"> <span class="press" title="중앙일보">중앙일보</span> <span class="bar"></span> 3시간 전 <span class="bar"></span><a class="_sp_each_url" href="https://news.naver.com/main/read.nhn?mode=LSD&amp;mid=sec&amp;sid1=101&amp;oid=025&amp;aid=0002931201" onclick="return goOtherCR(this, 'a=nws*c.nav&amp;r=2&amp;i=880000F2_000000000000000002931201&amp;u='+urlencode(this.href));" target="_blank">네이버뉴스</a> </span> </li> </ul> </dd> </dl> </li>
# 리스트에서 인덱싱으로 하나를 고르면, 그 이후부터는 
# 딕셔너리에서 키로 조회하는 것과 동일한 개념을 적용할 수 있습니다.
# 만약 우리가 제목만 가져오고 싶다고 한다면, 제목이 어떤 경로로 들어있는지 파악해야 합니다.
# 제목은 dl -> dt -> a 태그 순으로 들어있기 때문에 .findNext 로 구현해 줍니다.
step_03[0].findNext('dl').findNext('dt').findNext('a')
<a class="_sp_each_title" href="http://biz.chosun.com/site/data/html_dir/2019/08/21/2019082100788.html" onclick="return goOtherCR(this, 'a=nws*h.tit&amp;r=1&amp;i=88127058_000000000000000000441302&amp;g=366.0000441302&amp;u='+urlencode(this.href));" target="_blank" title="길어지는 메모리 보릿고개…인텔, 삼성 제치고 반도체 1위 다시 오를 듯">길어지는 메모리 보릿고개…인텔, <strong class="hl">삼성</strong> 제치고 <strong class="hl">반도체</strong> 1위 다시 오를 듯</a>
# 우리가 원하지 않는 정보인 태그정보 또한 포함되어있습니다.
# <> 로 묶여있는 부분만 제거해주면 우리가 원하는 제목의 정보만 가져오게 됩니다.
# 이는 .text 로 구현이 가능합니다.
step_03[0].findNext('dl').findNext('dt').findNext('a').text
# 리스트는 인덱싱으로 조회가 가능하고, 
# 인덱스는 0 부터 1 씩 증가하는 숫자이므로
# for 문과 리스트 인덱싱의 조합은 잘 어울립니다.
# 위의 코드에서 인덱싱 부분만 for 문에서 i 로 바꿔줍니다.

news_num = len(step_03)
for i in range(news_num-1):
    title = step_03[i].findNext('dl').findNext('dt').findNext('a').text
    print(title)
길어지는 메모리 보릿고개…인텔, 삼성 제치고 반도체 1위 다시 오를 듯
"삼성전자 반도체 생산 차질 없다...핵심소재 9개월치 확보" - KB
"삼성전자 반도체 생산 차질 없다...핵심소재 9개월치 확보" - KB
외교장관 회담 앞두고…日, 삼성에 반도체 소재 수출허가
외교장관 회담 앞두고…日, 삼성에 반도체 소재 수출허가
외교장관 회담 앞두고…日, 삼성에 반도체 소재 수출허가
[특징주]알파홀딩스, ‘삼성전자 반도체 SAFE ’ 부각+흑자 가능성에 상승세
전매 제한 없는 '평택 고덕 코오롱 하늘채 시그니처' 아파트, 삼성반도체 투자...
일본에서 반도체 핵심소재 수출 또 허가, 삼성전자 6개월치 물량 확보
이재용 부회장, 반도체·가전 이어 인재양성까지…잇따른 현장경영
이재용 부회장, 반도체·가전 이어 인재양성까지…잇따른 현장경영
[영상]백군기 용인시장 "용인을 반도체 소재 국산화의 전진기지로 삼겠다"
[단독] 미래 먹거리부터… 삼성 ‘脫일본 1순위’는 시스템 반도체’
# 제목 정보가 중복되어 나오는 것을 알 수 있는데, 
# 이를 해결하는 방법은 여러 가지가 있겠지만
# 가장 간단한 방법은, 파이썬의 set 자료형을 사용하는 것입니다.
# 리스트는 .append() 를 사용했지만 세트는 .add() 를 사용합니다.
# 리스트와 가장 크게 다른 점은, 세트는 중복 된 것이 들어가지 않는다는 점입니다.

titles = set()
news_num = len(step_03)
for i in range(news_num-1):
    title = step_03[i].findNext('dl').findNext('dt').findNext('a').text
    titles.add(title)
titles
{'"삼성전자 반도체 생산 차질 없다...핵심소재 9개월치 확보" - KB',
 '[단독] 미래 먹거리부터… 삼성 ‘脫일본 1순위’는 시스템 반도체’',
 '[영상]백군기 용인시장 "용인을 반도체 소재 국산화의 전진기지로 삼겠다"',
 '[특징주]알파홀딩스, ‘삼성전자 반도체 SAFE ’ 부각+흑자 가능성에 상승세',
 '길어지는 메모리 보릿고개…인텔, 삼성 제치고 반도체 1위 다시 오를 듯',
 '외교장관 회담 앞두고…日, 삼성에 반도체 소재 수출허가',
 '이재용 부회장, 반도체·가전 이어 인재양성까지…잇따른 현장경영',
 '일본에서 반도체 핵심소재 수출 또 허가, 삼성전자 6개월치 물량 확보',
 "전매 제한 없는 '평택 고덕 코오롱 하늘채 시그니처' 아파트, 삼성반도체 투자..."}
# 처음부터 반복문까지 구현한 코드는 다음과 같습니다.
# 이 코드의 의미를 잘 생각해보자면


# 1. 크롬 브라우저로 웹 페이지에 접속 합니다.
url = 'https://search.naver.com/search.naver?sm=tab_hty.top&where=news&query=%EC%82%BC%EC%84%B1+%EB%B0%98%EB%8F%84%EC%B2%B4&oquery=%EC%82%BC%EC%84%B1+%EB%B0%98%EB%8F%84%EC%B2%B4&tqi=USlkowp0Jy0ssSA7bylssssstTs-243856'
driver = webdriver.Chrome('chromedriver.exe')
driver.get(url)

# 2. 접속한 페이지의 정보를 문자열로 가져와 뉴스 정보가 들어있는 부분만 추려냅니다.
page = driver.page_source
step_01 = bs(page, 'html.parser')
step_02 = step_01.find('ul', class_ = "type01")
step_03 = step_02.findAll('li')

# 3. 뉴스 정보 중 제목 부분만 가져와 화면에 출력해 줍니다.
titles = set()
news_num = len(step_03)
for i in range(news_num-1):
    title = step_03[i].findNext('dl').findNext('dt').findNext('a').text
    titles.add(title)
print(titles)
{'"삼성전자 반도체 생산 차질 없다...핵심소재 9개월치 확보" - KB', "전매 제한 없는 '평택 고덕 코오롱 하늘채 시그니처' 아파트, 삼성반도체 투자...", '외교장관 회담 앞두고…日, 삼성에 반도체 소재 수출허가', '일본에서 반도체 핵심소재 수출 또 허가, 삼성전자 6개월치 물량 확보', '[영상]백군기 용인시장 "용인을 반도체 소재 국산화의 전진기지로 삼겠다"', '이재용 부회장, 반도체·가전 이어 인재양성까지…잇따른 현장경영', '[단독] 미래 먹거리부터… 삼성 ‘脫일본 1순위’는 시스템 반도체’', '[특징주]알파홀딩스, ‘삼성전자 반도체 SAFE ’ 부각+흑자 가능성에 상승세', '길어지는 메모리 보릿고개…인텔, 삼성 제치고 반도체 1위 다시 오를 듯'}

한 페이지의 뉴스 제목 정보를 전부 가져와 보았습니다.

다음 페이지로 넘어갈 수만 있다면 모든 정보를 가져올 수 있겠네요.

url = 'https://search.naver.com/search.naver?sm=tab_hty.top&where=news&query=%EC%82%BC%EC%84%B1+%EB%B0%98%EB%8F%84%EC%B2%B4&oquery=%EC%82%BC%EC%84%B1+%EB%B0%98%EB%8F%84%EC%B2%B4&tqi=USlkowp0Jy0ssSA7bylssssstTs-243856'
driver = webdriver.Chrome('chromedriver.exe')
driver.get(url)

page = driver.page_source
step_01 = bs(page, 'html.parser')
step_02 = step_01.find('ul', class_ = "type01")
step_03 = step_02.findAll('li')

titles = set()
news_num = len(step_03)
for i in range(news_num-1):
    title = step_03[i].findNext('dl').findNext('dt').findNext('a').text
    titles.add(title)
print(titles)

# 한 페이지의 정보를 전부 가져온 이후에
# 다음 페이지로 클릭해 넘어가야 합니다.

# 개발자 도구에서 선택 버튼을 누르고 다음 페이지 버튼을 클릭
# 소스코드에서 우클릭하여 x_path 를 복사해와 button 변수에 집어넣습니다.
# x_path 는 우리 마우스가 위치할 좌표를 의미합니다.
button = '//*[@id="main_pack"]/div[2]/div[2]/a[1]'

# 브라우저로 접속할 수 있게 도와주었던 driver 에 .find_element_by_xpath() 를 사용합니다.
# 여기에 마우스 클릭할 대상의 좌표인 x_path 정보를 집어넣고, .click() 을 실행하면
# 해당 위치에서 마우스로 유저가 클릭 한 것과 동일한 결과가 나오게 됩니다.
# (유저가 마우스로 다음 페이지로 넘어가는 버튼을 누르게 되는 것이지요.)
driver.find_element_by_xpath(button).click()
# 1페이지에서 2 페이지로 넘어가기 위한 x_path 는 다음과 같습니다.
# 각 페이지에서 다음 페이지로 넘어가기 위해 필요한 x_path 를 모으면 아래와 같습니다.
# 패턴이 보이시나요?
1 -> 2 = '//*[@id="main_pack"]/div[2]/div[2]/a[1]'

# 문자열의 마지막 부분에 마치 인덱싱과 같은 번호가 들어있습니다.
# 포매팅 등으로 이 번호만 바꿔준다면 버튼의 x_path를 쉽게 넣어줄 수 있겠습니다.

# 처음 클릭할 때를 제외하고는 일관성있게 1 씩 증가하는 패턴을 보이게 됩니다.
# 이 문자열에 1, 3, 4, 5, 6... 순으로 숫자를 넣어주거나
# 1 넣고 한 번 구한 다음에 3 부터 1 씩 증가하게끔 만들어줄 수도 있겠습니다.

2 -> 3 = '//*[@id="main_pack"]/div[2]/div[2]/a[3]'
3 -> 4 = '//*[@id="main_pack"]/div[2]/div[2]/a[4]'
4 -> 5 = '//*[@id="main_pack"]/div[2]/div[2]/a[5]'
5 -> 6 = '//*[@id="main_pack"]/div[2]/div[2]/a[6]'

# 2 를 제외하고1 부터  1씩 증가하는 등차수열을 만드는 것 보다 
# 3 부터 1 씩 증가한 것을 만드는 것이 더 쉬우므로, 이를 구현하겠습니다.
# 1. 크롬 브라우저로 웹 페이지에 접속 합니다.
driver = webdriver.Chrome('chromedriver.exe')
driver.get('https://search.naver.com/search.naver?sm=tab_hty.top&where=news&query=%EC%82%BC%EC%84%B1+%EB%B0%98%EB%8F%84%EC%B2%B4&oquery=%EC%82%BC%EC%84%B1+%EB%B0%98%EB%8F%84%EC%B2%B4&tqi=USlkowp0Jy0ssSA7bylssssstTs-243856')

# 접속한 페이지의 정보를 가져옵니다.
page = driver.page_source
step_01 = bs4.BeautifulSoup(page, 'html.parser')
step_02 = step_01.find('ul', class_ = "type01")
step_03 = step_02.findAll('li')

titles = set()
news_num = len(step_03)
for i in range(news_num-1):
    title = step_03[i].findNext('dl').findNext('dt').findNext('a').text
    titles.add(title)
print(titles)
# 다 가져온 상황입니다.

# 다음 페이지를 클릭 해 줍니다.
button = '//*[@id="main_pack"]/div[2]/div[2]/a[1]'
driver.find_element_by_xpath(button).click()



for page_number in range(5):
    # 접속한 페이지의 정보를 가져오고
    # 다음 페이지를 클릭 해 주기 까지를 반복문으로 묶어 줍니다.
    page = driver.page_source
    step_01 = bs4.BeautifulSoup(page, 'html.parser')
    step_02 = step_01.find('ul', class_ = "type01")
    step_03 = step_02.findAll('li')

    titles = set()
    news_num = len(step_03)
    for i in range(news_num-1):
        title = step_03[i].findNext('dl').findNext('dt').findNext('a').text
        titles.add(title)
    print(titles)

    # page_number 는 0 부터 1 씩 증가합니다.
    # 클릭하고자 하는 x_path 는 3 부터 1 씩 증가하므로
    # 1씩 증가하는 성질은 보존하면서 시작 지점만 바꿔주기 위해 3 을 더하여 구현합니다.
    button = '//*[@id="main_pack"]/div[2]/div[2]/a[%s]' % (page_number + 3)
    driver.find_element_by_xpath(button).click()
{'"삼성, 日 대신 벨기에서 반도체 소재 조달"', '“반도체 세계대전에서 한국은 반드시 승리할 것”', '삼성전자, 美오스틴 반도체공장서 ‘5G 생산성 향상’ 테스트', '“삼성, 반도체 소재 벨기에서 확보” 日매체 보도에…박재근 교수 “황당”', "반도체의 삼성 믿을만 하지만...우려는 '여전'", '반도체 시장서 日 존재감 미미...그마나도 반 넘게 ‘휘청’', '삼성전자 반도체, 인텔과 매출 격차 좁혀…IHS마킷 “메모리 사업 회복세”', "日 향한 D램 수출규제론 '솔솔'…반도체 업계는 '심드렁'", 'D램·낸드 놔두고…일본이 삼성 시스템반도체 겨냥한 이유', '평택에 반도체 소재·부품단지 짓는다'}
{'평택시, 반도체 클러스트 조성 계획 발표', '[단독] “일본, ‘삼성반도체’ 공급 중지 시기 면밀 조사”…치밀한 준비', '긴급회의 다음날 현장으로… 이재용, 반도체 최종라인 점검', '日 언론 "삼성, 벨기에서 반도체 소재 확보" 보도 사실무근', '日, 삼성 중국 시안 반도체 공장에 에칭가스 수출허가', '\'삼성 반도체의 은인\' 하마다 박사 "日, 실제로 수출중단 않을 것"', '日 반도체 원로의 쓴소리.."아베 총리, \'분업체계\' 수단으로 쓰지 말아야"', '반도체 불황에도…삼성전자, D램 시장 ‘압도적 1위’', '"日, 수출규제 36일만에 첫 허가···삼성 반도체 품목인듯"', '삼성, 반도체 소재 수입 ‘벨기에 루트’ 확보했나'}
{'日, 수출규제 후 對韓 반도체 소재 수출 일부 허가', '삼성전자, 반도체 미래기술 경쟁력 확보 위해 학계와 경계 허물다', '이재용 부회장 ‘반도체·디스플레이 긴급 사장단 회의’ 개최', '日, 규제 35일만에 반도체 소재 1건 첫 수출허가...이낙연 "불확실성 최소화 ...', '일본 수출 승인 1건은 삼성 반도체용…경제보복 이후 처음', '“日, ‘삼성반도체’ 공급 중지 시기 면밀 조사”…치밀한 준비', '존경받는 삼성전자 원하는 이재용, 반도체 투자에 협력사를 빼지 않다', '이재용 부회장 "일본 견제 굴하지 않고 \'반도체 비전 2030\'실현"', '[포럼] 한국반도체 기본기 다질 때다'}
{"반도체 위기서 '이재용 리더십' 보인다", '삼성전자 반도체 감산 불가피', '삼성전자 “난관 헤치고 ‘시스템 반도체’ 분야서도 1위 될 것”', '"20년간 4천600명 이발 봉사"…삼성전자 반도체 엔지니어 \'화제\'', '이재용 삼성전자 부회장, 평택사업장 찾아 반도체 사업 전략 점검', '반도체 불황에도···삼성전자 "감산 없다" 왜?', "[단독] 삼성전자, 상반기 성과급 '반도체' 기본급 100%", "이재용, '반도체 수출 제재'..日 출장 검토", '삼성전자, 울산과학기술원의 ‘3진법 반도체’ 기술연구 지원해 성과'}
{'이재용, 日 출장길 올라...반도체 소재 수출 규제 해법 모색', '[문답]日 반도체 조치→삼성·美에 부정적…정부가 밝힌 이유', "삼성반도체 직주근접 평택 '호반써밋 고덕' 이달 분양", '`반도체 쏠림` 우려 현실화…삼성전자, 영업이익 반토막', '반도체 대일수출 비중 1% 불과…무기화 실효성 없어', '일본언론 “일본의 반도체소재 한국 수출 허용에도 규제완화 장담못해”', '‘반도체·디스플레이·부품’ 업계, 2Q도 먹구름', '일본의 삼성 정조준에도…신규 메모리반도체 양산 ‘이상 무’', "삼성, 반도체 초격차 '가속화'…세계 최초 12Gb LPDDR5 양산", '"일본이 와서 빌어도 늦었다" 삼성, 반도체·스마트폰·가전서 일본 부품 싹 ...'}
{"삼성 반도체 3년내 '최악'…그래도 감산은 없다", '삼성전자 반도체 패키징 생산 라인 둘러보는 이재용', '이재용, 현재보다 미래…시스템반도체 직접 챙긴다', '삼성, 반도체·로봇 등 15개 미래기술 연구과제 지원', '일본 규제확대, 삼성 반도체 견제용', "日 제재 장기화땐 반도체 치명상… 파트너社 만나 '공멸' 설득[일본 간 이재용...", "삼성전자 반도체·디스플레이·로봇 '미래기술육성사업' 선정과제 발표", '이재용, 일본출장 통해 반도체 소재 긴급물량 확보했나?', '"日, 韓 급소 노렸다"…삼성 반도체 임원회의서 나온 장탄식'}