我想用一个选择列表来获取web数据,如图中所示。 enter image description herehttps://goodinfo.tw/StockInfo/ShowK_Chart.asp?STOCK_ID=3044&CHT_CAT2=DATE 我观察到,选择后会触发与post方法的链接。 我使用下面的代码获取数据,但没有返回任何内容
import requests
from bs4 import BeautifulSoup
[enter image description here][2]
Query_Para = {
'STOCK_ID': '3044',
'CHT_CAT2': 'DATE',
'STEP': 'DATA',
'PERIOD': '180'}
headers = {
'User-Agent': 'My User Agent99',
'From': 'youremail91@domain.com'
}
res = requests.post('https://goodinfo.tw/StockInfo/ShowK_Chart.asp', data = Query_Para, headers = headers)
res.encoding = 'utf-8'
soup = BeautifulSoup(res.text, "lxml")
是网络问题还是我的代码? 要得到数据吗
请帮忙。 非常感谢
目前没有回答
相关问题 更多 >
编程相关推荐