Beautiful Soup: 'ResultSet' object has no attribute 'find_all'?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to scrape a simple table using Beautiful Soup. Here is my code: import requests from bs4 import BeautifulSoup url = 'https://gist.githubusercontent.com/anonymous/c8eedd8bf41098a8940b/raw/c7e01a76d753f6e8700b54821e26ee5dde3199ab/gistfile1.txt' r = requests.get(url) soup = BeautifulSoup(r.text) table = soup.find_all(class_='dataframe') first_name = [] last_name = [] age = [] preTestScore = [] postTestScore = [] for row in table.find_all('tr'): col = table.find_all('td') column_1 = col[0].string.strip() first_name.append(column_1)