수강이 제한됩니다.
다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
안녕하세요 강사님! 5강 추가 질문 드립니다.
driver.find_element(By.XPATH, category_total).click() #스크롤 건드리면 안됨-> 위 코드 오류 원인이 뭘까요??
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
from selenium.webdriver.common.by import By
안녕하세요 5강 코드 오류 질문드립니다.
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
네이버쇼핑 리뷰 크롤링 관련 오류 문의
안녕하세요강의자료를 똑같이 복붙해서 따라했는데 아래 화면과 같이 오류가 나오네요.제가 참고한 강의자료는 [강의5_웹크롤링_20230316.ipynb]입니다.무슨 문제가 있는 걸까요?
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
실습 엑셀 파일 문의
섹션 5 프로펫 강의에 있는 '주방용품 매출' 데이터는 어디서 받을 수 있나요?? 항상 링크로 남겨주셨는데 보이지 않아 문의드립니다.!
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
Google Colab 코드작성 네이버 리뷰 코드 오류
안녕하세요 선생님. 네이버 리뷰 강의 듣다가 코드 오류때문에 글 남깁니다. Driver 네임 오류는 어떻게 고쳐야되나요?
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
링크 변경 애러 질문
###############################!!링크변경!!############################################################################# name = ['호박즙'] ns_address = "https://smartstore.naver.com/goldhouse/products/2698413198?n_keyword=&n_rank=1&n_query=%ED%98%B8%EB%B0%95%EC%A6%99&n_campaign_type=2&n_media=11068&n_campaign=cmp-a001-02-000000006259509&n_ad_group=grp-a001-02-000000031918432&n_ad=nad-a001-02-000000225350866&n_match=3&n_network=search&n_mall_id=ncp_1nm8fw_01&n_mall_pid=2698413198&n_ad_group_type=2&n_keyword_id=&n_ad_extension=&NaPm=ct%3Dlhelvdj4%7Cci%3D0z800028I5vytTVpXKYs%7Ctr%3Dpla%7Chk%3Dca9985f6cfe1114e75168d87872e9d4dd1a915ad" shoppingmall_review = "/html/body/div[2]/div/div[3]/div[2]/div[2]/div/div[3]/div[4]/div/div[3]/ul/li[2]/a" category_total = "/html/body/div[2]/div/div[3]/div[2]/div[2]/div/div[3]/div[6]/div/div[3]/div[1]/div[2]/ul/li[1]/a" ############################################################################################################ header = {'User-Agent': ''} driver.implicitly_wait(3) driver.get(ns_address) req = requests.get(ns_address,verify=True) html = req.text soup = BeautifulSoup(html, "html.parser") sleep(2) # 2023.05.08 변경 find_element_by_xpath TO find_element # element=driver.find_element_by_xpath(shoppingmall_review) element=driver.find_element(By.XPATH, shoppingmall_review) driver.execute_script("arguments[0].click();", element) sleep(2)예시에서 링크를 변경해서 대입해보면 아래와 같은 애러가 발생하네요..! 뭐가 문제일까요? NoSuchElementException Traceback (most recent call last) <ipython-input-5-15bf827fd88a> in <cell line: 10>() 8 # 2023.05.08 변경 find_element_by_xpath TO find_element 9 # element=driver.find_element_by_xpath(shoppingmall_review) ---> 10 element=driver.find_element(By.XPATH, shoppingmall_review) 11 driver.execute_script("arguments[0].click();", element) 12 sleep(2) /usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py in check_response(self, response) 243 alert_text = value["alert"].get("text") 244 raise exception_class(message, screen, stacktrace, alert_text) # type: ignore[call-arg] # mypy is not smart enough here --> 245 raise exception_class(message, screen, stacktrace) NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[2]/div/div[3]/div[2]/div[2]/div/div[3]/div[4]/div/div[3]/ul/li[2]/a"} (Session info: headless chrome=90.0.4430.212) Stacktrace: #0 0x55d22a7987f9 <unknown> #1 0x55d22a7383b3 <unknown> #2 0x55d22a480016 <unknown> #3 0x55d22a4b481e <unknown> #4 0x55d22a4ea8fb <unknown> #5 0x55d22a4d7ded <unknown> #6 0x55d22a4e89e1 <unknown> #7 0x55d22a4d7c93 <unknown> #8 0x55d22a4a9ce4 <unknown> #9 0x55d22a4ab4d2 <unknown> #10 0x55d22a764542 <unknown> #11 0x55d22a773ce7 <unknown> #12 0x55d22a7739e4 <unknown> #13 0x55d22a77813a <unknown> #14 0x55d22a7745b9 <unknown> #15 0x55d22a759e00 <unknown> #16 0x55d22a78b5d2 <unknown> #17 0x55d22a78b778 <unknown> #18 0x55d22a7a3a1f <unknown> #19 0x7f091bdac609 start_thread #20 0x7f091afc0133 clone
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
애러 질문
위 애러가 계속해서 나고있어요. 현재 강의는 [Google Colab 코드 작성(2) - (네이버리뷰) 코드 분석 및 코드 작성]을 듣고 있습니다.
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
에러 질문 드립니다 .
안녕하세요 쓰앵님수정 업로드 해주신 코드로 실습하고 있는데 또 오류가 나왔습니다 ㅠ앞부분은 다 됐는데header = {'User-Agent': ''} driver.implicitly_wait(3) driver.get(ns_address) req = requests.get(ns_address,verify=False) html = req.text soup = BeautifulSoup(html, "html.parser") sleep(2) element=driver.find_element_by_xpath(shoppingmall_review) driver.execute_script("arguments[0].click();", element) sleep(2)====run=====NameError Traceback (most recent call last) <ipython-input-9-8a5c5adbf17a> in <module> 1 header = {'User-Agent': ''} 2 driver.implicitly_wait(3) ----> 3 driver.get(ns_address) 4 req = requests.get(ns_address,verify=False) 5 html = req.text NameError: name 'ns_address' is not defined이름이 정의되지 않았다고 뜹니다.제가 어디서 잘못한 것일까요 ?chatgpt에도 넣어봤는데The error message indicates that the variable 'ns_address' has not been defined in the code. You need to define the 'ns_address' variable before using it in the 'driver.get()' method.이렇게만 나옵니다 알려주세요~
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
driver = webdriver.Chrome('chromedriver', options=chrome_options)
안녕하세요. 5강수업 실습 중 오류가 나와 문의 드립니다.# 셀레니움 module import from selenium import webdriver import time from time import sleep from bs4 import BeautifulSoup from selenium.webdriver.common.keys import Keys import requests import re import os # Dataframe import pandas as pd df = pd.DataFrame(columns=['idx','star','review']) chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--headless') chrome_options.add_argument('--no-sandbox') chrome_options.add_argument('disable-dev-shm-usage') chrome_options.add_argument("user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36") driver = webdriver.Chrome('chromedriver', options=chrome_options) 마지막줄이 계속 오류라고 나옵니다.driver = webdriver.Chrome('chromedriver', options=chrome_options) 이부분이요이 앞부분은 잘 됐는데 왜 이러는걸까요google colab에 그대로 복붙했는데 ㅠㅠ알려주세요 쓰앵님
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
기상청 온도정보 크롤링 강의 질문
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 강의와 동일한 내용으로 코드를 작성하는데,웹페이지 html 출력 영역에서 계속 오류가 납니다.처음에는 requests 이름 오류라고 뜨더니 이제는 모듈 타입에러라고 뜨는데,혹시 위 내용 어느 부분이 잘못된 것인지 문의 드립니다.
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
네이버 쇼핑 카테고리별 인기검색어 크롤링 강의 중 질문
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 선생님 안녕하세요!강의를 들으며 열심히 실습중인데 에러가 자꾸떠서요 ㅠㅠ맨처음에 if 문 넣기전에는 실행이 되었었는데 어찌된일인지 if문을 넣고 난 다음부터 자꾸 에러가 납니다 ㅠㅠ if문 넣기 전에 상품펼치기 지우기 전 자료는 new 상품 펼치기가 없었어요.. 혹시 그것때문은 아닐까요 ㅠㅠ왕왕 초보라 어렵네요 답변부탁드려요감사합니다!
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
적용 학습
안녕하세요리뷰 크롤링 하는 과정에서 다른 페이지에 적용 학습해보다가 에러코드가 떠서 질문드립니다.name = ['언더아머 CGI 다운'] ns_address = 'https://search.shopping.naver.com/search/all?query=cgi%20%EB%8B%A4%EC%9A%B4&frm=NVSHATC&prevQuery=%EB%89%B4%EB%B0%9C%EB%9E%80%EC%8A%A4%EB%B0%94%EB%9E%8C%EB%A7%89%EC%9D%B4' shoppingmall_review = "/html/body/div/div/div[2]/div[2]/div[2]/div[3]/div[1]/ul/li[3]/a" category_total = "/html/body/div/div/div[2]/div[2]/div[2]/div[3]/div[7]/div[2]/div[2]/ul/li[1]/a"순서대로 위와 같이 적용 완료하였는데요, 그 다음에 소스코드 주신 부분인 아래 부분을 적용하니까 다음과 같은 에러가 뜹니다. 확인 부탁드려도 될까요?header = {'User-Agent': ''} driver.implicitly_wait(3) driver.get(ns_address) req = requests.get(ns_address,verify=False) html = req.text soup = BeautifulSoup(html, "html.parser") sleep(2) element=driver.find_element_by_xpath(shoppingmall_review) driver.execute_script("arguments[0].click();", element) sleep(2)' 에러 - /usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning) --------------------------------------------------------------------------- NoSuchElementException Traceback (most recent call last) <ipython-input-30-8a5c5adbf17a> in <module> 6 soup = BeautifulSoup(html, "html.parser") 7 sleep(2) ----> 8 element=driver.find_element_by_xpath(shoppingmall_review) 9 driver.execute_script("arguments[0].click();", element) 10 sleep(2) 3 frames/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py in find_element_by_xpath(self, xpath) 392 element = driver.find_element_by_xpath('//div/td[1]') 393 """ --> 394 return self.find_element(by=By.XPATH, value=xpath) 395 396 def find_elements_by_xpath(self, xpath): /usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py in find_element(self, by, value) 976 return self.execute(Command.FIND_ELEMENT, { 977 'using': by, --> 978 'value': value})['value'] 979 980 def find_elements(self, by=By.ID, value=None): /usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py in execute(self, driver_command, params) 319 response = self.command_executor.execute(driver_command, params) 320 if response: --> 321 self.error_handler.check_response(response) 322 response['value'] = self._unwrap_value( 323 response.get('value', None)) /usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/errorhandler.py in check_response(self, response) 240 alert_text = value['alert'].get('text') 241 raise exception_class(message, screen, stacktrace, alert_text) --> 242 raise exception_class(message, screen, stacktrace) 243 244 def _value_or_default(self, obj, key, default): NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div/div/div[2]/div[2]/div[2]/div[3]/div[1]/ul/li[3]/a"} (Session info: headless chrome=105.0.5195.102) 그리고 다음 url과 같이 나타낼 페이지가 그리 많지 않은 경우에도 같은 소스코드 양식을 사용해도 될까요?https://search.shopping.naver.com/catalog/29274895216?query=cgi%20%EB%8B%A4%EC%9A%B4&NaPm=ct%3Dl8qn5dbs%7Cci%3Dcc97712ba6dec8be52ea670a2e607bb755d59f4f%7Ctr%3Dslsl%7Csn%3D95694%7Chk%3D97fd029ce7fc81750ad0a1d2110ad155b54fe09d 감사합니다.
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
Visual Code로 실행하고 싶습니다.
기존에 사용하던게 Visual code여서 이거 하나로만 사용하고 싶어서 코드로 복사하여 사용하고 관련 라이브러리를 설치하고 실행했는데 오류가 발생해서요. 혹시 Visual code에서도 실행할 수 있는 방법이 있을까요?? C:\StartCode>C:/Users/dantr/AppData/Local/Microsoft/WindowsApps/python3.10.exe c:/StartCode/교육/test1.pyc:\StartCode\교육\test1.py:21: DeprecationWarning: use options instead of chrome_options driver = webdriver.Chrome('chromedriver', chrome_options=chrome_options)Traceback (most recent call last): File "C:\Users\dantr\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\selenium\webdriver\common\service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 969, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1438, in executechild hp, ht, pid, tid = _winapi.CreateProcess(executable, args,FileNotFoundError: [WinError 2] 지정된 파일을 찾을 수 없습니다During handling of the above exception, another exception occurred:Traceback (most recent call last): File "c:\StartCode\교육\test1.py", line 21, in <module> driver = webdriver.Chrome('chromedriver', chrome_options=chrome_options) File "C:\Users\dantr\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init self.service.start() File "C:\Users\dantr\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\selenium\webdriver\common\service.py", line 81, in start raise WebDriverException(selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
Plot 의 범례 이름이 안나와요... ㅠ
안녕하세요? 항상 좋은 강의 해주셔서 감사 드립니다. 저는 아래와 같이 범례 이름이 나오지 않는데, 이유가 뭔가요? ㅠ - 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
쇼핑 크롤링 응용 질문 드립니다.
선생님께서 수업에서 보여주신 여러가지 크롤링을 응용해서 네이버 많이 구매하는 쇼핑 카테고리 크롤링 코드를 짜보았습니다. 그런데 해당 순위 100개까지 있는데, 현재 순위 15순위까지만 해서 나옵니다. 16위부터는 소스 자체에서 변화되는 것이 있을수 있는데 저로서는 한계네요 ;;; 리뷰 다음 페이지것까지 가져오기처럼 이것도 방법이 있을 것 같은데 혹시 알려주실 수 있을까요
- 미해결일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
기상청 기온정보 크롤링 관련 질문
안녕하세요, 기상청 기온정보 크롤링 관련 질문이 있습니다. 현재 기상청 접속 URL 이 아래와 같이 변경된 것으로 보입니다. https://www.weather.go.kr/w/obs-climate/land/past-obs/obs-by-day.do?stn=108&yy=2021&mm=12&obs=1 또한 태그 구조나 명칭도 변경된 것 같은데 weather_info로 클래스 가져오는 부분에 넣어야 할 클래스명은 아래와 같이 over-scroll 이라는 이름으로 변경하는 것으로 생각했습니다. weather_infor = soup.select(".over-scroll") 위와 같이 변경해봤습니다. 위 조건에서 weather info를 확인해보니 다음과 같았습니다. 강의에서 나온 태그 구조나 클래스 이름이 모두 변경된 것 같아서 예를 들어 기상청 사이트에서 21년 12월 1일의 태그 형식이 아래와 같습니다. 위의 조건에서 아래 코드를 실행하면 강사님 결과와 같은 결과가 나오지 않습니다. 아래 코드는 진행에 문제가 있었습니다. # 기온정보 list_climate_info = list() # 일자정보 list_day_info = list() for day_weather in weather_info: # 작업 1. 공백문자 제거 if(day_weather.get_text().isspace() != True): # 작업 1-1. 기온정보 if(day_weather.get_text().find("평균기온") == 0): list_climate_info.append(day_weather.get_text()) # 작업 1-2. 일자정보 else: list_day_info.append(day_weather.get_text()) 제가 변경한 조건에서 위 코드를 실행하면.... 아래와 같이 동일한 결과가 아닌데 어떻게 변경해야할지 모르겠습니다. 도움을 부탁드립니다.
- 미해결일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
5강 웹크롤링
- 5강 7분경에 네이버 쇼핑몰 크롤링 하면 리뷰가 나오는데 실제 카피해서 돌려보면 페이지 1 2 3 4 이렇게만 나오는건 왜 그런건가요? 강의대로 리뷰 내용을 보려면 어떻게 해야 하나요 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
- 해결됨일잘하는 마케터, MD에게 꼭 필요한 파이썬 데이터 분석
데이터시각화 파트에서 사용되는 엑셀파일은 어디서 받을 수있나요?
안녕하세요. 선생님, 강의 잘 듣고 있습니다~ 데이터 시각화에서 사용되는 엑셀파일들은 어디서 받을 수 있을지 문의드립니다. 강의에는 코드 url만 있어서요 ㅠㅠ 감사합니다.