python - Heroku flask app - Not able to scrape data -
i trying make 1 program can scrape site. achieve method implementing in heroku , flask.
app.py
from flask import flask import requests bs4 import beautifulsoup datetime import datetime app = flask(__name__) @app.route('/') def homepage(): r = requests.get('https://www.google.com') soup = beautifulsoup(r.content) l = soup.find_all('a') the_time = datetime.now().strftime("%a, %d %b %y %l:%m %p") return """ {time} \n\n\n {text} """.format(time=the_time,text = l) if __name__ == '__main__': app.run(debug=true, use_reloader=true)
but after deploying , going site, giving error , in log find this:
at=error code=h10 desc="app crashed" method=get path="/favicon.ico" host=young-chamber-36373.herokuapp.com request_id=68c83de9-1945-416c-8858-f9ff3d6ee496 fwd="171.77.135.239" dyno= connect= service= status=503 bytes= protocol=https
so doing wrong here ? in procfile added this: web: python app.py
not sure why not working. thanks
Comments
Post a Comment