通常我可以編寫一個腳本,用於抓取,但我一直在抓這個網站的表格爲我正在研究這個研究項目。我打算在輸入我的目標狀態的URL之前驗證在一個國家工作的腳本。問題與BS4颳去網站
import requests
import bs4 as bs
url = ("http://programs.dsireusa.org/system/program/detail/284")
dsire_get = requests.get(url)
soup = bs.BeautifulSoup(dsire_get.text,'lxml')
table = soup.findAll('div', {'data-ng-controller': 'DetailsPageCtrl'})
print(table)
#I'm printing "Table" just to ensure that the table information I'm looking for is within this sections
我不知道,如果該網站試圖從刮阻止的人,但所有我正在尋找搶的信息是「QUOT &」內,如果你的樣子表輸出。
你試過'html.parser'而不是'lxml'嗎? – martinB0103
你想要哪個頁面的哪一部分?以「計劃概述」爲主題的部分?還是那個以「權威」爲主的?或者是其他東西? –
@BillBell我正在尋找「程序概述」 – vlepore