소개
소개글이 비어있어요
게시글
고민있어요
2023.08.01 01:18
안녕하세요 반도체 분야 준비하는 학부생입니다.!
- 0
- 0
- 281
질문&답변
2023.07.25
질문이 두가지 있습니다.
find_all로는 이렇게 import requests from bs4 import BeautifulSoup res = requests.get(' https://davelee-fun.github.io/blog/crawl_test ') soup = BeautifulSoup(res.content,'html.parser') items = soup.find_all('a') items[15].get_text() css selector로는 import requests from bs4 import BeautifulSoup res = requests.get(' https://davelee-fun.github.io/blog/crawl_test ') soup = BeautifulSoup(res.content,'html.parser') items = soup.select ('ul#dev_course_list>li.course') items[8].get_text() 이런식으로 작성하니까 해결되네요;; 다해놓고 마지막 코드를 이상하게 작성하고 있었네요.. 그럼 제가 이런식으로 코드를 짜는건 제대로 한게 맞겠죠?
- 0
- 2
- 260
질문&답변
2023.07.25
질문이 두가지 있습니다.
아...for문을 돌리면 list형태에서 벗어난다는걸 까먹었네요,, 문자열로 바뀌는거죠?
- 0
- 2
- 260