Run a Python script on my website
<p>I am using <code>beautifulsoup</code> to scrape data from websites. </p>

<p>My code works when I run it from PyCharm.</p>

<p>When I run it on my website (like <code>newser.000webhost.com/new.py</code>) it does not run.  </p>

<p>How can I run my code on my site?</p>

<pre><code>import requests
from bs4 import BeautifulSoup

def trade_spider(max_pages):

    page = 1

    while page &lt;= max_pages:
        url = 'https://www.geo.tv/category/sports/'+ str(page)
        source_code = requests.get(url, allow_redirects=False)
        plain_text = source_code.text.encode('ascii', 'replace')
        soup = BeautifulSoup(plain_text, 'html.parser')

        for div in soup.findAll('div', {'class': 'geo-zoom-effect'}):
            for a in div.findAll('a'):
             title = a.get('title')
             href = a.get('href')
             print title
             print href

            for img in a.findAll('img'):
                src=img.get('src')
                print src

        page+=1

trade_spider(5)
</code></pre>