-
카테고리
-
세부 분야
업무 자동화
-
해결 여부
미해결
GuessedAtParserWarning가 뜨고 r의 타입이 다르게 나옵니다
20.08.04 20:54 작성 조회수 448
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타입이 다르게 나오는 것을 어떻게 해결하나요?
업무 자동화를 위한 파이썬 pyautogui, beautifulsoup 크롤링 기초
2022년 업데이트 - 파이썬 웹크롤링 멜론 TOP100 실시간 차트순위 검색결과 가져오기 - beautifulsoup, requests 기초 사용법
강의실 바로가기
답변을 작성해보세요.
0
hyohead2
질문자2020.08.07
답변 감사합니다!
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
답변 2