title: Handling pound sign (#) in python requests
body: <p>I'm using requests to compile a custom URL and one parameter includes a pound sign. Can anyone explain how to pass the parameter without encoding the pound sign?</p>
  
  <p>This returns the correct CSV file</p>
  
  <pre><code>results_url = 'https://baseballsavant.mlb.com/statcast_search/csv?all=true&amp;hfPT=&amp;hfAB=&amp;hfBBT=&amp;hfPR=&amp;hfZ=&amp;stadium=&amp;hfBBL=&amp;hfNewZones=&amp;hfGT=R%7C&amp;hfC=&amp;hfSea=2019%7C&amp;hfSit=&amp;player_type=batter&amp;hfOuts=&amp;opponent=&amp;pitcher_throws=&amp;batter_stands=&amp;hfSA=&amp;game_date_gt=&amp;game_date_lt=&amp;hfInfield=&amp;team=&amp;position=&amp;hfOutfield=&amp;hfRO=&amp;home_road=&amp;hfFlag=&amp;hfPull=&amp;metric_1=&amp;hfInn=&amp;min_pitches=0&amp;min_results=0&amp;group_by=name&amp;sort_col=pitches&amp;player_event_sort=h_launch_speed&amp;sort_order=desc&amp;min_abs=0&amp;type=#results'
  results = requests.get(results_url, timeout=30).content
  results_df = pd.read_csv(io.StringIO(results.decode('utf-8')))
  </code></pre>
  
  <p>This DOES NOT</p>
  
  <pre><code>URL = 'https://baseballsavant.mlb.com/statcast_search/csv?'
  
  def _get_statcast(params):
  
       _get = get(URL, params=params, timeout=30)
       _get.raise_for_status()
       return _get.content
  </code></pre>
  
  <p>The issue seems to be that when passing '#results' through requests anything after '#' gets ignored which causes the wrong CSV to be downloaded. If anyone has thoughts on other ways of going about this I would appreciate it. </p>
  
  <p>EDIT2: Also asked this on the python forum <a href="https://python-forum.io/Thread-Handling-pound-sign-within-custom-URL?pid=75946#pid75946" rel="nofollow noreferrer">https://python-forum.io/Thread-Handling-pound-sign-within-custom-URL?pid=75946#pid75946</a></p>