502 Bad Gateway using Beautiful Soup, Python / Django

A beautiful soup runs in a Python shell using Django. I can also successfully import from bs4 import BeautifulSoup into views.py, but when I call something like soup = BeautifulSoup(xml) , I get 502 Bad Gateway error. I spoke with my host and they could not find the problem. Any ideas?

Note that xml has the value xml = urllib2.urlopen("http://isbndb.com/api/books.xml?access_key=000000&results=details&index1=isbn&value1=0000").read() , but it works in the Python shell (in my myproject folder), so I don't think the problem is.

0
source share
2 answers

This is similar to the interaction between Cython and mod_wsgi described here and studied in the context of Beautiful Soup.

+1
source

Try copying and pasting this URL into your browser. I get an access key error; fix it and your problem is resolved.

0
source

Source: https://habr.com/ru/post/1436567/


All Articles