inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

봉하윤님의 게시글

봉하윤 봉하윤

@qhdgkdbs0142

수강평 작성수
4
평균평점
5.0

게시글 2

질문&답변

string관련 오류..

아 해결되었어요ㅎㅎ 파일을 c://로 옮겨서 실행해 보니깐 되요....!! 그런데 왜 같은 같은 폴더에 두면 실행이 안되고, c드라이브로 옮겨야 실행이 되는 건 가요? 감사합니당

좋아요수
0
댓글수
3
조회수
771

질문&답변

string관련 오류..

from bs4 import BeautifulSoup import sys import io sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding = 'utf-8') sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding = 'utf-8') fp = open("food-list.html",encoding = "utf-8") soup = BeautifulSoup(fp,"html.parser") print(soup.select_one("li:nth-of-type(8)")) print("2", soup.select_one("#ac-list > li:nth-of-type(4)")) 라는 코드를 돌리면 None [Finished in 0.186s] 이라는 결과가 나옵니다. 같은 폴더에는 food-list.html이라는 파일이 있고요ㅠㅠ 안주 및 주류 닭도리탕 돈까스 삼겹살 스테이크 소주 맥주 막걸리 양주 동동주 답변 부탁드려요 =ㅠ

좋아요수
0
댓글수
3
조회수
771