pythonanywhere - Flask 请求错误
问题描述
尝试使用 Flask 从 Pythonanywhere(付费帐户)上的 Web 应用程序发出请求。这在本地 PC 上根据需要工作,但在 Pythonanywhere 上收到错误。
@app.route('/test/')
def test():
url_cookies='https://www.phoenixcontact.com/online/portal/ru/pxc/offcontext/'
headers = {'authority': 'www.phoenixcontact.com', 'method': 'GET','user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'}
requestCookies = requests.get(url_cookies,headers=headers)
return 'Test'+requestCookies.text
解决方案
推荐阅读
- jquery - 目标特定按钮 - Jquery
- java - java 11和spring boot错误:this_class应该是module-info
- r - 如何在数组的行中添加值,但分别保留每个矩阵的结果
- reactjs - 在模板文字中使用组件
- android - 如何防止Android矢量每次都被重新膨胀并重绘为位图?
- ios - 检测屏幕上出现的 UITableViewCells
- regex - 2个正则表达式独立正常工作,但组合时不能正常工作
- pca - 没有协方差矩阵的 PCA?
- r - r gplot 主题——我想确定使用的颜色
- python - 在不丢失括号的情况下,将列表转换为集合,然后与集合列表一起“加入”