Python程序报错:AttributeError: module 'requests' has no attribute 'args'


import requests

from flask import Flask, render_template_string

app = Flask(__name__)

@app.route('/xss/')

def xss():
    code = requests.args.get('id')
    html = '''
        <h3>%s</h3>
    '''%(code)
    return render_template_string(html)

if __name__ == '__main__':
    app.run()

报错:

AttributeError: module 'requests' has no attribute 'args'

文件名:001.py

这行代码应该这样写

    code = request.args.get('id')


这里用的应该是flask库中的request, 你这样写python去找requests库了