Repository navigation
[問題] 用python做parse #3383
Unanswered
LeoTsai999
asked this question in
Q&A
Replies: 1 comment
Feature Parity — Data SourceThe Product Releases Tracker (project #2463) is the source of truth for feature gaps. From the first 100 items:
3,794 total items in the tracker. The Shipped (pending GHES) items are features fully available on dotcom but not yet on GHES/Proxima — these are the feature parity gaps to inventory and prioritize. Key fields to analyze: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
這是在ptt上看到的一篇關於python的小問題,覺得很有趣,想和大家分享一下。
之前沒學過python
google到的教學文章有範例 但卻不懂原理..
請問一下我今天假使要parse證交所的收盤價
http://0rz.tw/n8qLj
是要先自己分析網頁的原始碼 找出我要的資料在哪裡
然後再parse嗎?
原始碼長得像這樣子http://ppt.cc/IhfX
請問該如何做parse
麻煩給點指導 謝謝!
--
當你要解析網頁上的資料,比如證交所的收盤價時,的確需要先分析網頁的原始碼,找到你想要提取的資料位置。以下是一些步驟和建議來幫助你理解這個過程:
分析網頁原始碼:
table、tr和td等。使用適合的工具進行解析:
BeautifulSoup和lxml。這些庫可以幫助你輕鬆解析 HTML 內容並提取所需資訊。requests套件開始,這是一個用來發送 HTTP 請求的庫,配合BeautifulSoup或lxml來解析回應的 HTML。範例流程:
requests獲取網頁資料。BeautifulSoup來解析獲得的 HTML 內容,根據前面分析的結果提取特定的元素。創新性建議:
robots.txt檔案,查看可否合法爬取該網站的數據。pandas套件將提取的資料轉換成資料框(DataFrame),這樣可以簡化數據處理和分析的過程。學習方向:
希望這些建議能幫助你順利解析證交所的收盤價!如果有其他問題,歡迎隨時詢問。
All reactions