inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

176만명의 커뮤니티!! 함께 토론해봐요.

쿠팡 사이트 접속 제한은?

해결됨

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

강의 잘 들었습니다! 쿠팡 사이트에 여러번 시도를 하니까 엑세스 디나인이 뜨더라구요. 강사님은 혹시 이것이 발생하는 주기를 알고 계실까요? 예) 1분에 10번 이상 접속 시도시 차단. 차단되면 1일 후 이용 가능. 이런 대략적인 정보나? 경험이 있으면 알려주시면 감사하겠습니다!

  • python
  • 웹-크롤링
  • selenium
  • beautifulsoup
김선영 댓글 2 좋아요 1 조회수 2219

ancestor :: span[2] 어떻게 해석해야 할지 //ancestor :: div[2] -- 질문

미해결

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

ancestor :: span[2] 어떻게 해석해야 할지 모르겠습니다. //ancestor :: div[2] --------- 질문 :: div등 [1] [2] 번호의 의미와 분석법 , ancestor :: span[2] ancestor 쓴는 이유와 찾는 방법 순서 .. 궁금합니다 ~

  • python
  • 웹-크롤링
  • selenium
  • beautifulsoup
what? just run 댓글 2 좋아요 0 조회수 558

야후파이낸스 크롤링 오류

해결됨

내 업무를 대신 할 파이썬(Python) 웹크롤링 & 자동화 (feat. 주식, 부동산 데이터 / 인스타그램)

7.1 진행중에 request 오류가나서 기존 질문답변 보고 강의노트에 올려주신 헤더 넣어서 requests.get했는데도 response 404가 나옵니다. 확인 부탁 드립니다.

  • python
  • 웹-크롤링
wk 댓글 1 좋아요 0 조회수 862

셀레니움으로 thumb 이미지 클릭을 못합니다 도와주세요 ㅠ

해결됨

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

선생님 난관에 부딪혔습니다. 제목과, 이름은 잘가져오는데. 썸네일 이미지가 메뉴에 가려져 있어서, 클릭을 못한다고 합니다. 이를 어찌 해결해야 할지 도저히 모르겠습니다 일단 코드는 아래와 같습니다. items = driver.find_elements(By.CSS_SELECTOR, "#_chartList > li.list_item") time.sleep(2) #_chartList .title.ellipsis for idx, item in enumerate(items[:5], 1): title = item.find_element(By.CSS_SELECTOR, 'p.title.ellipsis') name = item.find_element(By.CSS_SELECTOR, 'span.name.ellipsis') thumb = item.find_element(By.CSS_SELECTOR, 'div.thumb > a') thumb.click() time.sleep(2) album_url = driver.current_url driver.back() print(f">>>{idx}<<<") print(title.text.strip()) print(name.text.strip()) print(album_url) print() time.sleep(2) 실행하면 아래와 같은 오류가 납니다. selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <a href="javascript:goDetail('album','11211297')">...</a> is not clickable at point (40, 24). Other element would receive the click: <span class="ico-sprite ico-gnb-menu">...</span> 구글링 열심히 하다가 챗 gpt에게 물어보니 오약 : 메뉴 요소에 가려져있어서 클릭을 못하고, 메뉴 요소를 닫아야 한다고합니다 <span class="ico-sprite ico-gnb-menu"> 이 메뉴 요소가 문제인거 같은데, 메뉴에 가려져 있으면 어떻게 해결 해야하나요? 어떡해든 혼자힘으로 해결해 보려고 하였는데, 이건 도저히 해결책을 어떻게 연구해야 할지 모르겠습니다. 도와 주신다면 감사하겠습니다.

  • python
  • 웹-크롤링
  • selenium
  • beautifulsoup
가후 댓글 1 좋아요 0 조회수 598

px.line 그리기에 대해서 문의 드립니다.

미해결

파이썬 증권 데이터 수집과 분석으로 신호와 소음 찾기

반복 적으로 관심 종목을 불러와서 챠트를 그리고 싶어서 while 문으로 구성 해 봤는데, 챠트가 출력되지 않습니다. 어디가 문제일까요? 문제가 된 while 문 출력 결과 입니다. 출력 결과 관심 종목을 입력 받으면 입력 받은 종목의 챠트를 출력하고, 다음 종목을 입력 받기를 기다리게 구성하였고, n or N을 입력하면 종료하는 것으로 구성하였습니다. 그런데 결과물에 챠트가 출력되지 않습니다. 한 종목 출력하면 출력이 됩니다.

  • python
  • pandas
  • numpy
  • 웹-크롤링
  • seaborn
  • plotly
  • matplotlib
  • 웹-스크래핑
trulife72 댓글 1 좋아요 0 조회수 379

영상보면 크롬에서 자동화 메세지 안나오는 옵션을 입력한 상태인데, 메세지가 나오고 있습니다.

해결됨

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

자동화 메세지 안나오는 코드 입력후 options.add_experimental_option('excludeSwitches', ['enable-automation']) 크롬을 실행하면, 자동화 메세지지가 안나옵니다. 그러나 1분 58초 입니다. 크롬에서 오류 메세지 안보내는, 코드를 입력하면 자동화 메세지가 출력됩니다 options.add_experimental_option('excludeSwitches', ['enable-logging']) 즉 자동화 메세지 안나오는 코드 입력상태 이고 오류 메세지 안나오는 코드 입력상태 인데 위 두가지 조건을 입력하면 자동화 메세지가 안나오고 and 오류 메세지도 안나와야 하는데.. 오류 메세지는 나오지만, 자동화 메세지가 출력됩니다. 그래서 영상을 돌려보니, 선생님 강의 영상에서도 똑같은 증상이 나오고 있습니다! 아래는 선생님강의 영상 캡쳐 입니다 제 생각에는 add_experimental_option은 아래에 있는 코드가 적용되는게 아닐까 추측되네요. 저도 초보이지만, 저보다 늦게 공부하시는 분을 위해 남겨 둡니다. 저처럼 고민하시는 분들이 있으실수도 있으니까요

  • python
  • 웹-크롤링
  • selenium
  • beautifulsoup
가후 댓글 1 좋아요 0 조회수 387

8강 jupyter 첫 실행부터 막히네요..

미해결

[리뉴얼] 파이썬입문과 크롤링기초 부트캠프 [파이썬, 웹, 데이터 이해 기본까지] (업데이트)

다 설치하고 jupyter notebook 실행시키고 수업 듣고 있는데, 저는 왜 shift+ent 눌러도 저렇게 줄만 바뀔까요. 선생님 알려주시는 것처럼 출력이 안됩니다.. 그리고 Untitled name도 바꿔보려고 했는데 어떤 걸 입력해도 error 라고만 뜹니다. 마지막으로 질문을 올리다보니 제 화면이 선생님 화면과 다른 점이 우측 상단에.. Python 3 (ipykernel)이라고 되어 있네요? 선생님 화면은 Python 3만 나와 있습니다..ㅠㅠ 누가 좀 알려주세요ㅠㅠ 흑흑

  • python
  • 웹-크롤링
Lucy 댓글 1 좋아요 0 조회수 724

기초적인 질문 질드려요 vscode에서 clear 명령어 사용

미해결

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

강의 영상중에서 5분 27초 보면 vscode 터미널 내용지울땐, 선생님께서 clear 라는 입력하시고 엔터 누르시면, 터미널 내용이 사라집니다. 저는 clear라고 하면, 'clear'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다. 위와 같이 나옵니다. 그래서 찾아보니, cls라고 하면 지워진다고 하는데, 선생님처럼 clear 명령어를 사용하고 싶습니다. 선생님께서는 터미널 단축키를 수정 하신건지 아니면 다른 터미널을 사용 하신건지 궁금합니다. 이게 간단한거 같으면서도, 검색으로는 더이상 알아낼수가 없네요 알려 주시면 감사하겠습니다.

  • python
  • 웹-크롤링
  • selenium
  • beautifulsoup
가후 댓글 2 좋아요 0 조회수 6053

귀신이 곡할 노릇입입니다ㅠㅠ , 셀렉터를 맞게 한거 같은데 안되네요 ㅠㅠ

해결됨

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

블랙핑크 검색시 셀렉터 손흥민 검색시 셀렉터 즉 선생님 수업때와 다르게 셀렉터가 둘다 똑같이 변경 되었습니다. import requests from bs4 import BeautifulSoup base_url = "https://search.naver.com/search.naver?where=view&sm=tab_jum&query=" keyword = input("검색어를 입력하세요 :") url = base_url + keyword # url = "https://search.naver.com/search.naver?where=view&sm=tab_jum&query=손흥민" headers = {"User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"} req = requests.get(url, headers=headers) soup = BeautifulSoup(req.text, 'html.parser') results = soup.select(".timeline_area") print(results) for res in results: # print(res.select_one('.sub_txt.sub_name').text) # print(res.select_one('.api_txt_lines.total_tit').text) # print(res.select_one('.api_txt_lines.total_tit').get('href')) print() 그래서 위와같이 select 해서 크롤링을 하면 정말 너무 희안하게도 "블랙핑크" : 크롤링 가능 "손흥민" : 크롤링 불가능 print(results) 해보면, 리스트가 비어있습니다. 그래서 제가 아래 이미지 처럼 개발자 도구에서 select copy 를 이용해서도 해봤는데 크롤링이 안됩니다. 도저히 제가 이해할수가 없고, 해결할수 없어서 질문 드립니다. 도와주신다면 감사하겠습니다. ㅠㅠ

  • python
  • 웹-크롤링
  • selenium
  • beautifulsoup
가후 댓글 2 좋아요 1 조회수 632

[REST API] data의 교환방식 질문

미해결

쉽게 처음하는 파이썬 고급 크롤링 [Scrapy, Selenium, Headless Chrome]

- 본 강의 영상 학습 관련 문의에 대해 답변을 드립니다. (어떤 챕터 몇분 몇초를 꼭 기재부탁드립니다) - 이외의 문의등은 평생강의이므로 양해를 부탁드립니다 - 현업과 병행하는 관계로 주말/휴가 제외 최대한 3일내로 답변을 드리려 노력하고 있습니다 - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. <동적 웹사이트와 크롤링> - REST API 안녕하세요. 강의 잘 듣고 있습니다. REST API라고 하는 것이 데이터를 주고 받는 방법인 것은 알겠는데요. 이것이 프론트엔드와 백엔드의 데이터를 주고받는 방식이라고 이해하는게 좀 어려워서 부가설명을 부탁드립니다. 회사를 기준으로 이해하다보니 더 와닿지 않습니다. 제가 가끔씩 보는 사내의 IT개발은 JSP로된 2000줄 정도 되는 코드에 어떤 데이터가 필요하면, 데이터를 뽑는 쿼리를 데이터 베이스 담당하시는분한테 묻고 그 해당 쿼리를 집어넣고??하는 방식으로 하는 것 같은데, 제가 집에서하는 템플릿 코드 작성방식과와 다르지 않다고 이해해오고 있는데요. 규모가 큰 회사에서는 OPEN API 설명서처럼 백엔드에서DATA를 전달하는 방식을 구현해 놓는건가요? 그리고 한가지만 더 질문을 드리면, 제가 Flask 강의도 듣고 있는데요. 사실 백엔드와 프론트엔드의 차이를 잘 느끼지 못했습니다. 하나의 템플릿에 데이터를 넣어주는 역할까지를 백엔드가 하고 단지 프론트는 그 템플릿을 예쁘게 하는 역할을 하는것인가요? 만약 그렇다면 템플릿 상속도 있고, HTML CODE도 계속해서 변하는데 구분없이 혼자하는게 더 수월하겠다는 생각이 들어서요. 어떤 식으로 역할을 분배하고 일하는지 궁금합니다. 정말 좋은 강의 잘듣고 있습니다. 감사합니다!

  • 빅데이터
  • 웹-크롤링
  • scrapy
  • selenium
poqw741 댓글 1 좋아요 1 조회수 739

5/6 tqdm으로 전체 데이터...

미해결

파이썬 증권 데이터 수집과 분석으로 신호와 소음 찾기

concat으로 전제 종목을 합치는 pd.concat(result.tolist()) 코드 실행시 오류가 납니다. 오류 메세지는 : InvalidIndexError: Reindexing only valid with uniquely valued Index objects 입니다. get_item_info 함수를 실행해서 result 결과를 확인해 보니, index 가 모두 같지 않은 것 같습니다. 오류 부분이 어디일까요?

  • python
  • pandas
  • numpy
  • 웹-크롤링
  • seaborn
  • plotly
  • matplotlib
  • 웹-스크래핑
trulife72 댓글 2 좋아요 0 조회수 1198

에러??

미해결

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

import os import openai openai.api_key = "내꺼 api key 가림" completion = openai.ChatCompletion.create( model = "gpt-3.5-turbo", messages=[{"role": "user", "connect": "Hello"}]) print(completion.choices[0].message) Traceback (most recent call last): File "C:\Users\82109\PycharmProjects\10.selenium_option\venv\openai_test.py", line 5, in <module> completion = openai.ChatCompletion.create( model = "gpt-3.5-turbo", messages=[{"role": "user", "connect": "Hello"}]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\82109\PycharmProjects\10.selenium_option\venv\Lib\site-packages\openai\api_resources\chat_completion.py", line 25, in create return super().create(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\82109\PycharmProjects\10.selenium_option\venv\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 153, in create response, _, api_key = requestor.request( ^^^^^^^^^^^^^^^^^^ File "C:\Users\82109\PycharmProjects\10.selenium_option\venv\Lib\site-packages\openai\api_requestor.py", line 226, in request resp, got_stream = self._interpret_response(result, stream) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\82109\PycharmProjects\10.selenium_option\venv\Lib\site-packages\openai\api_requestor.py", line 620, in _interpret_response self._interpret_response_line( File "C:\Users\82109\PycharmProjects\10.selenium_option\venv\Lib\site-packages\openai\api_requestor.py", line 683, in _interpret_response_line raise self.handle_error_response( openai.error.InvalidRequestError: Additional properties are not allowed ('connect' was unexpected) - 'messages.0' Process finished with exit code 1 위는 에러 메시지 입니다.

  • python
  • 웹-크롤링
  • selenium
  • beautifulsoup
댓글 2 좋아요 0 조회수 1074

03. 연예뉴스크롤링하기에 질문 있습니다.

해결됨

[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)

import requests from bs4 import BeautifulSoup import time response = requests.get( "https://search.naver.com/search.naver?where=news&sm=tab_jum&query=%EB%B8%94%EB%9E%99%ED%95%91%ED%81%AC") html = response.text soup = BeautifulSoup(html, 'html.parser') articles = soup.select("div.info_group") # 뉴스 기사 div 10개 추출 for article in articles: links = article.select("a.info") # 리스트 if len(links) >= 2: # 링크가 2개 이상이면 url = links[1].attrs['href'] # 두번째 링크의 href를 추출 response = requests.get(url, headers={'User-agent':'Mozila/5.0'}) html = response.text soup = BeautifulSoup(html, 'html.parser') # 만약 연예 뉴스라면 if "entertain" in response.url: title = soup.select_one(".end_tit") content = soup.select_one("#articleBody") else: title = soup.select_one(".media_end_head_headline") content = soup.select_one("#dic_area") print("====링크====", url) print("====제목====", title.text.strip()) print("====본문====", content.text.strip()) time.sleep(0.3) 위와 같이 코드를 짜고 실행했는데, https://entertain.naver.com/read?oid=629&aid=0000209267 이사이트 차례가 되자 content를 못 뽑아냅니다. 다음과 같은 에러를 나타냅니다. ====링크==== https://n.news.naver.com/mnews/article/629/0000209267?sid=106 ====제목==== 블랙핑크 지수, 요란하지 않은 '꽃'의 유혹[TF초점] Traceback (most recent call last): File "C:\Users\asd20\Desktop\startcoding_crawling\Chapter04\03.연예뉴스크롤링하기.py", line 27, in <module> print("====본문====", content.text.strip()) AttributeError: 'NoneType' object has no attribute 'text' 개발자도구를 눌러 html 구조를 확인해봐도 원인을 잘 모르겠습니다.

  • python
  • 웹-크롤링
asd203n 댓글 2 좋아요 0 조회수 483

네이버 일반 뉴스 페이지의 HTML이 변경된것 같습니다.

해결됨

[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)

import requests from bs4 import BeautifulSoup response = requests.get( "https://search.naver.com/search.naver?where=news&sm=tab_jum&query=%EC%82%BC%EC%84%B1%EC%A0%84%EC%9E%90") html = response.text soup = BeautifulSoup(html, 'html.parser') articles = soup.select("div.info_group") # 뉴스 기사 div 10개 추출 for article in articles: links = article.select("a.info") # 리스트 if len(links) >= 2: # 링크가 2개 이상이면 url = links[1].attrs['href'] # 두번째 링크의 href를 추출 response = requests.get(url, headers={'User-agent':'Mozila/5.0'}) html = response.text soup = BeautifulSoup(html, 'html.parser') content = soup.select_one("#articleBodyContents") print(content.text) 본문 내용의 ID가 articleBodyContents아닙니다. 그래서 "#dic_area"로 생각해서, 변경하고 진행했는데, 강사님처럼 전체 텍스트가 출력되는게 아니라 일부만 출력됩니다. 전체 텍스트를 볼려면 어떻게 해야하나요?

  • python
  • 웹-크롤링
asd203n 댓글 1 좋아요 0 조회수 619

앱 크롤링

미해결

Node.js로 웹 크롤링하기

수업 잘듣고 있습니다 교육내용가 관련없지만 웹말고 앱 크롤링이 가능한가요?

  • javascript
  • node.js
  • 웹-크롤링
  • puppeteer
김동호 댓글 1 좋아요 0 조회수 1851

selenium 명령어 자동완성 안됨

미해결

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

vscode 사용하고 있습니다. 코딩과 실행 모두 문제는 없으나 selenium 관련 명령 입력할때는 김플님 강의화면과 달리 자동완성 기능이 작동하지 않습니다. 예를 들어, options = Options() options. 까지 입력하면 여러가지가 나오고 그 중 add_experimental_option 이 떠야되는데 그렇지 않아 매번 직접 타이핑하고 있습니다. 해결방법이 있을까요?

  • python
  • 웹-크롤링
  • selenium
  • beautifulsoup
evr 댓글 1 좋아요 0 조회수 504

다음 카페 크롤링

미해결

실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용

다음 카페 크롤링을 이 강의를 통해 하고 있습니다. 다음 카페 로그인 및 해당 게시판 까지는 이동이 되는 데, 해당 글 내용에 대한 크롤링이 되지 않습니다(Xpath나 class를 이용해도 게시글이 클릭도 안되는데 그 이유가 궁급합니다.ㅠㅠ / ) <a href="/_c21_/bbs_read?grpid=5RFF&amp;fldid=Acvb&amp;contentval=002Lizzzzzzzzzzzzzzzzzzzzzzzzz&amp;datanum=9034&amp;page=1&amp;prev_page=0&amp;firstbbsdepth=&amp;lastbbsdepth=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz&amp;listnum=20" class="txt_item">심한 자폐아이 </a> 여기 안에 있는 내용을 가지고 오고 그 아래 부분의 글로 가지고 오려고 합니다...

  • python
  • 웹-크롤링
  • selenium
  • beautifulsoup
dahy905 댓글 2 좋아요 0 조회수 1437

for문에서 창 전환 후 에러 해결 방법 문의

미해결

[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)

from selenium import webdriver # webdriver 불러오기 from selenium.webdriver.chrome.options import Options # 브라우저 닫힘 방지 from selenium.webdriver.chrome.service import Service # 크롬드라이버 다운로드(새로운 버전 다시 받을 필요 없음) from webdriver_manager.chrome import ChromeDriverManager # 크롬드라이버 다운로드(새로운 버전 다시 받을 필요 없음) import time import pyautogui from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys options = Options() options.add_experimental_option('detach', True) # 브라우저 바로 닫힘 방지 options.add_experimental_option('excludeSwitches', ['enable-logging']) # 불필요한 메시지 제거 service = Service(ChromeDriverManager().install()) #service = Service(ChromeDriverManager().install()) 이 부분을 # ChromeDriverManager(path="원하는 경로") 이렇게 사용하면 원하는 곳에 # 크롬드라이버를 다운로드하게 됩니다. driver = webdriver.Chrome(service=service, options=options) driver.get("https://www.g2b.go.kr:8101/ep/tbid/tbidFwd.do") time.sleep(2) search_click = driver.find_element("#bidNm").click() keyword = pyautogui.prompt("<<<검색어를 입력하세요 >>>") search_keyword = driver.find_element(By.CSS_SELECTOR,"#bidNm").send_keys(keyword) output_num = driver.find_element(By.CSS_SELECTOR,"#recordCountPerPage").click() output_num_select = driver.find_element(By.CSS_SELECTOR,"#recordCountPerPage > option:nth-child(5)").click() search_btm_click = driver.find_element(By.CSS_SELECTOR,"#buttonwrap > div > a:nth-child(1)").click() bid_infors = driver.find_elements(By.CSS_SELECTOR,"tbody tr") for bid in bid_infors : title = bid.find_element(By.CSS_SELECTOR,"td:nth-child(4) > div > a").text link = bid.find_element(By.CSS_SELECTOR,"td:nth-child(4) > div > a").get_attribute('href') client = bid.find_element(By.CSS_SELECTOR,"td:nth-child(5) > div").text print("공고명 : ", title) print("주소 : ", link) print("발주처 : ",client ) print() # 사전규격 크롤링 driver.get("https://www.g2b.go.kr:8081/ep/preparation/prestd/preStdSrch.do") time.sleep(2) keyword2 = pyautogui.prompt("<<<검색어를 입력하세요 >>>") search_keyword2 = driver.find_element(By.CSS_SELECTOR,"#prodNm").send_keys(keyword2) output_num2 = driver.find_element(By.CSS_SELECTOR,"#recordCountPerPage").click() output_num2_select2 = driver.find_element(By.CSS_SELECTOR,"#recordCountPerPage > option:nth-child(5)").click() search_btm_click2 = driver.find_element(By.CSS_SELECTOR,"#frmSearch1 > div.button_wrap > div > a:nth-child(1)").click() bid_infors2 = driver.find_elements(By.CSS_SELECTOR,"tbody tr") for bid2 in bid_infors2: title2 = bid2.find_element(By.CSS_SELECTOR, "td:nth-child(4) > div > a").text client2 = bid2.find_element(By.CSS_SELECTOR, "td:nth-child(5) > div").text link_click = bid2.find_element(By.CSS_SELECTOR, "td:nth-child(4) > div > a").click() time.sleep(2) link2 = driver.current_url print("공고명 : ", title2) print("주소 : ", link2) print("발주처 : ",client2) print() driver.back() time.sleep(2) 위 코드에서 발생하는 코드는 아래와 같습니다. Traceback (most recent call last): File "c:\coding\나라장터크롤링\1.입찰공고크롤링.py", line 61, in <module> title2 = bid2.find_element(By.CSS_SELECTOR, "td:nth-child(4) > div > a").text File "C:\Users\landj\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webelement.py", line 425, in find_element return self._execute(Command.FIND_CHILD_ELEMENT, {"using": by, "value": value})["value"] File "C:\Users\landj\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webelement.py", line 403, in _execute return self._parent.execute(command, params) File "C:\Users\landj\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute self.error_handler.check_response(response) File "C:\Users\landj\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document 이것 저것 다해봐도 안되네요...해결 방법을 알려주시면 감사하겠습니다.

  • python
  • 웹-크롤링
코딩초보 댓글 1 좋아요 0 조회수 1493

자바스크립트로 된 링크 가져오는 방법이 궁금합니다.

해결됨

[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)

토요코인 수업 중에 위에 보는 것과 같이 자바스크립트로 링크가 걸려있는 경우 실제 url을 크롤링 하려면 어떻게 해야 하나요?

  • python
  • 웹-크롤링
코딩초보 댓글 1 좋아요 0 조회수 1256

PermissionError: [WinError 5] 액세스가 거부되었습니다

미해결

[신규 개정판] 이것이 진짜 크롤링이다 - 기본편

안녕하세요 강의에서 알려주신 내용 바탕으로 해보고 있는데 어느순간부터 'PermissionError: [WinError 5] 액세스가 거부되었습니다' 라는 메세지가 나옵니다. 해당 메세지가 가르키는 줄을 보면 아래 코드중 service 부분에서 발생합니다. 어떻게 하면 수정할수있을지 도움말씀 부탁드립니다. service = Service(executable_path=ChromeDriverManager().install()) browser = webdriver.Chrome(service=service, options=chrome_options)

  • python
  • 웹-크롤링
kshssi 댓글 1 좋아요 0 조회수 2592

인기 태그

인프런 TOP Writers

주간 인기글