【发布时间】:2020-07-06 08:41:14
【问题描述】:
目前,我正在为一个网站进行网络抓取,当页面自动加载时,我需要在该网站上获取数据。我正在使用 BeautifullSoup 和请求。
import requests
from bs4 import BeautifulSoup
page = requests.get("https://www.monki.com/en/newin/view-all-new.html")
soup = BeautifulSoup(page.content, 'html.parser')
article_codes=[]
for k in soup.findAll('div',attrs={"class":"producttile-details"}):
article_code = k.find('span', attrs={'class':"articleCode"})
print(article_code)
article_codes.append(article_code.text)
使用此代码,我只获取页面的数据,但我想要页面加载后的所有数据。
【问题讨论】:
标签: python python-3.x web-scraping beautifulsoup python-requests