【发布时间】:2017-05-23 08:03:44
【问题描述】:
在抓取此页面 (http://bobaedream.co.kr/cyber/CyberCar_view.php?no=652455&gubun=I) 时,我的代码返回了我无法理解的错误消息。
在 div 标签 (div class='rightarea') 下,有许多标签。但是当我尝试读取和收集数据时,它不断返回错误消息,(content_table1 = table.find_all('div', class_='information') 'ResultSet' object has no attribute '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')
请帮忙。
【问题讨论】:
标签: python html web-crawler