커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
뉴스 크롤링 자동화 관련 질문
[왕초보] 칼퇴를 부르는 파이썬 업무 자동화 v0
2주차
북마크
김*원
댓글
3
추천
0
조회수
26
조회수
26
답변 완료

뉴스 크롤링 자동화 코드 작성을 통해서

해당 페이지의 첫번째 기사까지는 불러와지는데요.

그 외에 다른 기사들이 불러와지지 않고, 아래와 같은 에러메세지가 뜨면서 오류가 발생하고 있습니다.


크롬브라우저의 문제인가 싶어서, 크롬 드라이브 매니저 관련된 코드를 가져와보고,

크롬 브라우저의 보안을 약하게 해보고 했는데요.


크롬 브라우저 버전 문제인건가 싶기도 하고,

잘 해결되지 않고 아직까지 동일한 현상이 발생하고 있네요.


해당 문제내용에 대해서 문의 드립니다.



작성한 코드 및 에러 메세지

(.venv) C:\automation\crwalling>c:/automation/crwalling/.venv/Scripts/python.exe c:/automation/crwalling/news_crawling.py

뉴스 키워드를 입력하세요 : 팀스파르타

팀스파르타, 상반기 매출 297억·영업익 65억..."2배 이상 성장"

Traceback (most recent call last):

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\connection.py", line 196, in _new_conn

  sock = connection.create_connection(

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\util\connection.py", line 85, in create_connection

  raise err

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection

  sock.connect(sa)

ConnectionRefusedError: [WinError 10061] 대상 컴퓨터에서 연결을 거부했 으므로 연결하지 못했습니다


The above exception was the direct cause of the following exception:  


Traceback (most recent call last):

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\connectionpool.py", line 789, in urlopen

  response = self._make_request(

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\connectionpool.py", line 495, in _make_request

  conn.request(

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\connection.py", line 398, in request

  self.endheaders()

 File "C:\Users\1994d\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1278, in endheaders

  self._send_output(message_body, encode_chunked=encode_chunked)   

 File "C:\Users\1994d\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1038, in _send_output

  self.send(msg)

 File "C:\Users\1994d\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 976, in send

  self.connect()

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\connection.py", line 236, in connect

  self.sock = self._new_conn()

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\connection.py", line 211, in _new_conn

  raise NewConnectionError(

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000029C1CC3C8E0>: Failed to establish a new connection: [WinError 10061] 대상 컴퓨터에서 연결을 거부했으므로 연결하지 못했습니다


The above exception was the direct cause of the following exception:  


Traceback (most recent call last):

 File "c:\automation\crwalling\news_crawling.py", line 20, in <module>

  print(title.text)

 File "c:\automation\crwalling\.venv\lib\site-packages\selenium\webdriver\remote\webelement.py", line 89, in text

  return self._execute(Command.GET_ELEMENT_TEXT)["value"]

 File "c:\automation\crwalling\.venv\lib\site-packages\selenium\webdriver\remote\webelement.py", line 394, in _execute

  return self._parent.execute(command, params)

 File "c:\automation\crwalling\.venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 342, in execute

  response = self.command_executor.execute(driver_command, params)  

 File "c:\automation\crwalling\.venv\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 294, in execute

  return self._request(command_info[0], url, body=data)

 File "c:\automation\crwalling\.venv\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 315, in _request

  response = self._conn.request(method, url, body=body, headers=headers)

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\_request_methods.py", line 136, in request

  return self.request_encode_url(

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\_request_methods.py", line 183, in request_encode_url

  return self.urlopen(method, url, **extra_kw)

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\poolmanager.py", line 443, in urlopen

  response = conn.urlopen(method, u.request_uri, **kw)

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\connectionpool.py", line 873, in urlopen

  return self.urlopen(

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\connectionpool.py", line 873, in urlopen

  return self.urlopen(

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\connectionpool.py", line 873, in urlopen

  return self.urlopen(

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\connectionpool.py", line 843, in urlopen

  retries = retries.increment(

 File "c:\automation\crwalling\.venv\lib\site-packages\urllib3\util\retry.py", line 519, in increment

  raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]

urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=53723): Max retries exceeded with url: /session/859d4a57949fffd0a857b1455d3391c0/element/f.47C8C851DA017E949CD35E50C95611CD.d.3E8CE463D947B85A44EAEBB0B5256320.e.279/text (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000029C1CC3C8E0>: Failed to establish a new connection: [WinError 10061] 대상 컴퓨터에서 연결을 거부 했으므로 연결하지 못했습니다'

취소
 공유
취소
댓글 0
댓글 알림
나의얼굴