작성
·
592
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타입이 다르게 나오는 것을 어떻게 해결하나요?
답변 2
0
답변 감사합니다!
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