inflearn logo
강의

講義

知識共有

仕事の自動化のためのPython pyautogui、beautifulsoupクロールの基盤

2022年アップデート - Python ウェブスクレイピング Melon TOP100 リアルタイムチャートランキング 検索結果を取得 - beautifulsoup, requests 基礎的な使い方

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

707

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

kimfl

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

import time

0

64

1

크롤링 실행시 멈춤

0

612

2

에러가 너무 납니다.

0

666

1

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

0

516

0

import

0

260

0

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

0

283

0

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

1

302

1

FileNotFound Error

0

413

0

import error

0

377

1

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

0

184

0

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

0

206

0

Pyautogui.moveTo 작동이 안돼요

1

495

0

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

0

440

0

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

1

507

1

에러가 뜹니다

0

219

0

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

0

344

0

keyError 해결

1

282

1

오류 관련 질문이요

0

747

1

공유하고 싶은 점

2

185

1

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

0

268

1

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

0

221

1

질문있습니다.

0

237

1

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

0

262

1

하나만 더 질문할게요..

0

237

1