title: Command Line input for Python Script
body: <p><strong>What I am trying to do here:</strong></p>
  
  <p>I am trying to crawl yelp and get reviews from a particular page. However, I just want to modify this script to give "<em>Restaurant name</em>" as input.</p>
  
  <p>For example: </p>
  
  <p>User Input: 
  <strong>dennys-san-jose-5</strong></p>
  
  <pre><code>URL: http://www.yelp.com/biz/**dennys-san-jose-5**
  </code></pre>
  
  <p><strong>This is the actual script I am using right now:</strong></p>
  
  <pre><code>from bs4 import BeautifulSoup
  from urllib import urlopen
  queries = 0
  while queries &lt;201:
      stringQ = str(queries)
      page = urlopen('http://www.yelp.com/biz/madison-square-park-new-york?start=' + stringQ)
  
      soup = BeautifulSoup(page)
      reviews = soup.findAll('p', attrs={'itemprop':'description'})
      authors = soup.findAll('span', attrs={'itemprop':'author'})
  
      flag = True
      indexOf = 1
      for review in reviews:
          dirtyEntry = str(review)
          while dirtyEntry.index('&lt;') != -1:
              indexOf = dirtyEntry.index('&lt;')
              endOf = dirtyEntry.index('&gt;')
              if flag:
                  dirtyEntry = dirtyEntry[endOf+1:]
                  flag = False
              else:
                  if(endOf+1 == len(dirtyEntry)):
                      cleanEntry = dirtyEntry[0:indexOf]
                      break
                  else:
                      dirtyEntry = dirtyEntry[0:indexOf]+dirtyEntry[endOf+1:]
          f=open("reviews.txt", "a")
          f.write(cleanEntry)
          f.write("\n")
          f.close
  
      for author in authors:
          dirty = str(author)
          closing = dirty.index('&gt;')
          dirty = dirty[closing+1:]
          opening = dirty.index('&lt;')
          cleanEntry = dirty[0:opening]
          f=open("bla.txt", "a")
          f.write(cleanEntry)
          f.write("\n")
          f.close 
      queries = queries + 40
  </code></pre>
  
  <p>I am trying to read the restaurant name as parameter but it does not work somehow.</p>
  
  <p><strong>What i did:</strong></p>
  
  <pre><code>while queries &lt;201:
      stringQ = str(queries)
      page = urlopen('http://www.yelp.com/biz/' + stringQ)
  </code></pre>
  
  <p>But it does not work. I am giving <strong>dennys-san-jose-5</strong> as input from commandline (python script.py dennys-san-jose-5) </p>
  
  <p>Please suggest me the issue here and how I can fix.</p>
  
  <p>Regards,</p>