2024-04-23 12:11:05 发布
网友
尝试返回以下站点时,我遇到以下错误:
“请求的对象在此服务器上不存在。您使用的链接可能已过期、不准确,或者服务器已被指示不让您使用它。“
任何帮助都会很好,也尝试过用urllib解析,运气不好。将链接粘贴到浏览器中似乎效果不错。你知道吗
r = requests.get('https://us.spdrs.com/product/fund.seam?ticker=QCAN') print(r.text)
正如@CuriousGeorge所怀疑的,结果因源IP而异:
import requests response = requests.get('https://us.spdrs.com/product/fund.seam?ticker=QCAN') for r in response.history: print(r.status_code, r.url) print(response.url)
美国:
301 https://us.spdrs.com/product/fund.seam?ticker=QCAN 301 https://us.spdrs.com/en/product/fund.seam?ticker=QCAN 301 https://us.spdrs.com/product/fund.seam?ticker=QCAN 301 https://us.spdrs.com/en/product/fund.seam?ticker=QCAN 301 https://us.spdrs.com/etf/spdr-msci-canada-strategicfactors-etf-QCAN https://us.spdrs.com/en/etf/spdr-msci-canada-strategicfactors-etf-QCAN
法国:
301 https://us.spdrs.com/product/fund.seam?ticker=QCAN 302 https://fr.spdrs.com/fr/product/fund.seam?ticker=QCAN 301 https://fr.spdrs.com/product/fund.seam?ticker=QCAN 302 https://fr.spdrs.com/fr/product/fund.seam?ticker=QCAN 301 https://fr.spdrs.com/product/index.seam?cid=0 https://fr.spdrs.com/fr/product/index.seam?cid=0
加拿大:
301 https://us.spdrs.com/product/fund.seam?ticker=QCAN https://global.spdrs.com/product/fund.seam?ticker=QCAN
正如@CuriousGeorge所怀疑的,结果因源IP而异:
美国:
法国:
加拿大:
相关问题 更多 >
编程相关推荐