
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
분명 강의랑 똑같이 코드를 작성하고 그 전 단계인 날씨 까지는 잘 따라 했는데 뉴스 키워드를 검색했을때는 키워드가 제대로 뜨지 않네요
보고 계신 화면 전체를 캡

처해 주시면, 튜터님들이 빠르게 상황을 이해할 수 있어요.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)
chrome_options.add_experimental_option("excludeSwitches", ["enable-logging"])
driver = webdriver.Chrome(options=chrome_options)
keyword = input('뉴스 키워드를 입력하세요.')
# 예시로 Google의 날씨 정보 페이지로 이동
driver.get(f"https://search.naver.com/search.naver?ssc=tab.news.all&where=news&sm=tab_jum&query={keyword}")
title_list=driver.find_elements(By.CLASS_NAME,'news_tit')
for title in title_list:
print(title.text)
driver.quit()
뉴스 키워드를 입력하세요.파이썬
Traceback (most recent call last):
File "c:\Users\장지혜\Desktop\automation\crawling\news_crawling.py", line 13, in <module>
driver.get(f"https://search.naver.com/search.naver?ssc=tab.news.all&where=news&sm=tab_jum&query={keyword}")
File "c:\Users\장지혜\Desktop\automation\crawling\.venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 353, in get
self.execute(Command.GET, {"url": url})
File "c:\Users\장지혜\Desktop\automation\crawling\.venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 344, in execute
self.error_handler.check_response(response)
File "c:\Users\장지혜\Desktop\automation\crawling\.venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed
from unknown error: web view not found
(Session info: chrome=127.0.6533.72)
Stacktrace:
GetHandleVerifier [0x00007FF690449632+30946]
(No symbol) [0x00007FF6903FE3C9]
(No symbol) [0x00007FF6902F6FDA]
(No symbol) [0x00007FF6902CCB85]
(No symbol) [0x00007FF6903737A7]
(No symbol) [0x00007FF69038A771]
(No symbol) [0x00007FF69036C813]
(No symbol) [0x00007FF69033A6E5]
(No symbol) [0x00007FF69033B021]
GetHandleVerifier [0x00007FF69057F83D+1301229]
GetHandleVerifier [0x00007FF69058BDB7+1351783]
GetHandleVerifier [0x00007FF690582A03+1313971]
GetHandleVerifier [0x00007FF69047DD06+245686]
(No symbol) [0x00007FF69040758F]
(No symbol) [0x00007FF690403804]
(No symbol) [0x00007FF690403992]
(No symbol) [0x00007FF6903FA3EF]
BaseThreadInitThunk [0x00007FF8C7CD257D+29]
RtlUserThreadStart [0x00007FF8C8B8AF28+40]
(.venv) C:\Users\장지혜\Desktop\automation\crawling>
