hi, 各位大大
小弟之前有写爬虫每周爬取及保护股权分散表,从上周后好像网页改版后就无法抓取,
试了一周还是搞不定,只能来求助大神帮忙解惑,感谢
错误讯息如下
<html><body><h1>SRVE0255E: A WebGroup/Virtual Host to handle
/smWeb/QryStockAjax.do has not been defined.</h1><br/><h3>SRVE0255E: A
WebGroup/Virtual Host to handle www.tdcc.com.tw:443 has not been
defined.</h3><br/></body></html>
资料爬取方式
import requests
from bs4 import BeautifulSoup as BS
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36'}
info = {'SYNCHRONIZER_TOKEN':'c0fa73d9-db72-499f-a10f-d87cb046c047',
'SYNCHRONIZER_URI': '/portal/zh/smWeb/qryStock',
'method': 'submit',
'firDate': '20221007',
'scaDate': '20221007',
'sqlMethod': 'StockNo',
'stockNo': '2330',
'stockName': ''
}
res = requests.post('https://www.tdcc.com.tw/smWeb/QryStockAjax.do', data =
info, headers = headers)
soup = BS(res.text, "lxml")
print(soup)