我正在使用Python 3,并且正在嘗試從網站檢索數據。但是,此數據是動態加載的,我現在擁有的代碼不起作用:url = eveCentralBaseURL + str(mineral)print("URL : %s" % url);response = request.urlopen(url)data = str(response.read(10000))data = data.replace("\\n", "\n")print(data)在嘗試查找特定值的地方,我找到的是模板,例如“ {{formatPrice平均數}}”而不是“ 4.48”。我該如何做才能檢索值而不是占位符文本?編輯:這是我要從中提取信息的特定頁面。我正在嘗試獲取“中位數”值,該值使用模板{{formatPrice平均數}}編輯2:我已經安裝并設置了程序以使用Selenium和BeautifulSoup。我現在擁有的代碼是:from bs4 import BeautifulSoupfrom selenium import webdriver#...driver = webdriver.Firefox()driver.get(url)html = driver.page_sourcesoup = BeautifulSoup(html)print "Finding..."for tag in soup.find_all('formatPrice median'): print tag.text這是程序執行時的屏幕截圖。不幸的是,它似乎找不到指定“ formatPrice average”的任何內容
添加回答
舉報
0/150
提交
取消