inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

업무 자동화를 위한 파이썬 pyautogui, beautifulsoup 크롤링 기초

2022년 업데이트 - 파이썬 웹크롤링 멜론 TOP100 실시간 차트순위 검색결과 가져오기 - beautifulsoup, requests 기초 사용법

GuessedAtParserWarning가 뜨고 r의 타입이 다르게 나옵니다

711

hyohead2

작성한 질문수 1

0

C:\Users\hyoyi\PycharmProjects\crawling\venv\Scripts\python.exe C:/Users/hyoyi/PycharmProjects/crawling/google.py

무엇을 검색할까요? : 파이썬

<class 'bs4.element.ResultSet'>

C:/Users/hyoyi/PycharmProjects/crawling/google.py:13: GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

The code that caused this warning is on line 13 of the file C:/Users/hyoyi/PycharmProjects/crawling/google.py. To get rid of this warning, pass the additional argument 'features="html.parser"' to the BeautifulSoup constructor.

  soup = BeautifulSoup(html)

<class 'bs4.element.ResultSet'>

Process finished with exit code 0

오류랑 r타입이 다르게 나오는 것을 어떻게 해결하나요?

웹-크롤링 python

답변 2

0

hyohead2


답변 감사합니다!

from
urllib.parse import quote_plus
from bs4 import BeautifulSoup
from selenium import webdriver

baseUrl = "https://www.google.com/search?q="
plusUrl = input("무엇을 검색할까요? : ")
url = baseUrl + quote_plus(plusUrl)

driver = webdriver.Chrome()
driver.get(url)

html = driver.page_source
soup = BeautifulSoup(html)

r = soup.select(".r")
print(type(r))


0

김플

작성한 코드를 에러메세지와 함께 올려주세요.

import time

0

74

1

크롤링 실행시 멈춤

0

621

2

에러가 너무 납니다.

0

677

1

에러가 아래와 같이 뜨는데 어떤 이유 일가요?

0

526

0

import

0

266

0

소스 다운은 어디서 받나요?

0

293

0

네이버가 현재 강의로는 크롤링 안되게 해놓았네요

1

311

1

FileNotFound Error

0

421

0

import error

0

385

1

.text 사용 시 값이 비어있는 칸은 nonetype이 들어가서 에러가 발생하는데 예외처리를 어떻게 해야하나요 ?

0

190

0

크롤링 할때 sh_blog_title 형식으로 안나오는데요! ㅠ

0

213

0

Pyautogui.moveTo 작동이 안돼요

1

501

0

네이버 검색 크롤링에서 무한 스크롤 문제 해결

0

450

0

키에러가 나는데 어떻게 해야하는지 궁금합니다.

1

512

1

에러가 뜹니다

0

224

0

스크린샷 폴더 위치 어떻게 아나요?

0

349

0

keyError 해결

1

294

1

오류 관련 질문이요

0

754

1

공유하고 싶은 점

2

199

1

크롤링 실행할 때 질문입니다!!

0

274

1

클래스에 궁금한 점이요!!

0

227

1

질문있습니다.

0

242

1

주피터 노트북에서는 안되나요?

0

266

1

하나만 더 질문할게요..

0

243

1