看板 Python 關於我們 聯絡資訊
各位大神 小弟我最近想要爬各國匯率簡化工作流程 但真的太菜了想問一點小問題 import requests from bs4 import BeautifulSoup req=request.get('https://invest.cnyes.com/forex/detail/USDTWD/history') html=req.content.decode('utf8') soup=BeautifulSoup(html,'lxml') for td in Soup.findAll('td'): text=td.text.strip print(text) 看網站原始碼是有對道數字,但實際爬出來就只有-- 我html真的菜QQ,想詢問原因,拜託各位大大了 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.141.174.116 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1682174118.A.7AA.html
Hsins: 透過 JS 抓資料再渲染的 04/22 23:37
IM014: 太好了我用selenium成功了 04/23 17:25
ToastBen: https://github.com/psf/requests-html 04/23 17:37