作者IM014 (014)
看板Python
标题[问题] 小菜鸡爬汇率询问
时间Sat Apr 22 22:35:16 2023
各位大神
小弟我最近想要爬各国汇率简化工作流程
但真的太菜了想问一点小问题
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://webptt.com/cn.aspx?n=bbs/Python/M.1682174118.A.7AA.html
1F:→ Hsins: 透过 JS 抓资料再渲染的 04/22 23:37
2F:→ IM014: 太好了我用selenium成功了 04/23 17:25