Web/python 썸네일형 리스트형 [python](error) is not in list 배열 값 중 index를 알아오기 위해 index 함수 사용 시 ValueError: 값 is not in list 에러 발생 해당 에러는 리스트 안에 '값이 없을 때 발생 하기 코드 실행 시 'ValueError: 5 is not in list' 에러 발생 arrVal = [1, 2, 3, 4] print(arrVal.index(5) 예외처리 try : idx = arr.index(val) except ValueError : print("ValueError") [python] python web crawling 참고 사이트 https://wikidocs.net/85381 0. 머리말 2022년 1월, 비전공자를 위한 파이썬 자동화 완벽 가이드 원고 작업을 시작합니다. wikidocs.net [python] BeautifulSoup 파이썬을 이용한 웹 크롤링 시 데이터 추출하기 위한 함수 requests 설치 pip install requests BeautifulSoup 설치 pip install beautifulsoup4 파이썬에서 기본 내장함수가 아니라서 import 필요 import requests from bs4 import eautifulSoup 사용법 import requests from bs4 import BeautifulSoup url = 'https://naver.com' res = requests.get(url) if res.status_code == 200: html = res.text soup = BeautifulSoup(html, 'html.parser') print(soup) else : print(res... 이전 1 다음