我是websoup的初學者,我無法設法在以下網站上刮幾頁(5)http://www.newyorksocialdiary.com/party-pictures(http://www.newyorksocialdiary.com/party-pictures?page=1-5)&我不知道如何把數據框中的輸出(日期)。謝謝!如何刮掉後續頁面並將輸出放在數據框中
from bs4 import BeautifulSoup
import requests
for i in range(10):
url= "http://www.newyorksocialdiary.com/party-pictures".format(i)
r=requests.get(url)
soup= BeautifulSoup(r.text)
for r in soup.findAll('span', attrs={'class': 'views-field views-field-created'}) :
print r.get_text()
謝謝!非常... –