【发布时间】:2017-04-19 08:41:23
【问题描述】:
大家好,今天我有一个具体问题要问,我如何从不断变化的网站(例如在线赌博网站)中抓取数据。当我执行这段代码时,我写了
import requests
from bs4 import BeautifulSoup
def ColorRequest():
url = 'http://csgoroll.com/#/' # Could add a + pls str(pagesomething) to add on to the url so that it would update
sourcecode = requests.get(url) #requests the data from the site
plaintext = sourcecode.text #imports all of the data gathered
soup = BeautifulSoup(plaintext, 'html.parser') #This hold all of the data, and allows you to sort through all of the data, converts it
for links in soup.findAll():
print(links)
ColorRequest()
我得到了页面的 html 输出,但我正在寻找页面加载后显示的元素,而不是构成该页面的元素。
任何有经验的 Python 开发人员都遇到过这个问题,请帮助没有经验的程序员解决这个问题?
【问题讨论】:
标签: python html dynamic screen-scraping