このページ(http://bobaedream.co.kr/cyber/CyberCar_view.php?no=652455&gubun=I)をクロールしているうちに、わかりにくいエラーメッセージが表示されます。PythonコードでHTML要素が見つかりません
divタグ(div class = 'rightarea')には、いくつかのタグがあります。しかし、データを読み込んで収集しようとすると、エラーメッセージが返されます(content_table1 = table.find_all( 'div'、class _ = 'information') 'ResultSet'オブジェクトには 'find_all'という属性がありません)。変わったことは、私のコードは、異なるリストページのこのデータ部分を収集するためのエラーメッセージを返しません。以下は
は私のコードです:
from bs4 import BeautifulSoup
import urllib.request
from urllib.parse import urlparse
from urllib.parse import quote
from selenium import webdriver
import re
import csv
URL = 'http://bobaedream.co.kr/cyber/CyberCar_view.php?no=652455&gubun=I'
res = urllib.request.urlopen(URL)
html = res.read()
soup = BeautifulSoup(html, 'html.parser')
# Basic Information
table = soup.find_all('div', class_='rightarea')
print(table)
# Number, Year, Mileage, Gas Type, Color, Accident
content_table1 = table.find_all('div', class_='information')
助けてください。