title: Showing two différents errors with the same code that I used to scrape other pages
body: <p>I used a code to scrape two pages from tripadvisor, and it worked very well. But  now, it shows me two differents errors :</p>
  
  <p>
  
  <pre class="lang-js prettyprint-override"><code>with open("iletaitunsquare1.csv", "w", encoding="utf-8-sig", newline='') as csv_file:
      w = csv.writer(csv_file, delimiter = ";", quoting=csv.QUOTE_MINIMAL)
      w.writerow(["inf_rest_name", "rest_eclf", "name_client", "date_rev_cli", "opinion_cl"])
  
      with requests. Session() as s:
          for offset in range (270,1230,10):
              url = f'https://www.tripadvisor.fr/Restaurant_Review-g187147-d6575305-Reviews-or{offset}-Il_Etait_Un_Square-Paris_Ile_de_France.html'
              r = s.get(url)
              soup = bs(r.content, 'lxml')
              reviews = soup.select('.reviewSelector')
              ids = [review.get('data.reviewid') for review in reviews]
              r = s.post(
                      'https://www.tripadvisor.fr/OverlayWidgetAjax?Mode=EXPANDED_HOTEL_REVIEWS_RESP&amp;metaReferer=',
                      data = {'reviews': ','.join(ids), 'contextChoice': 'DETAIL'},
                      headers = {'Referer': r.url}
                      )
  
              soup = bs(r.content, 'lxml')
              if not offset:
                  inf_rest_name = soup.select_one('.heading').text.replace("\n","").strip()
                  rest_eclf = soup.select_one('.header_links a').text.strip()
  
              for review in soup.select('.reviewSelector'):
                  name_client = review.select_one('.info_text &gt; div:first-child').text.strip()
                  date_rev_cl = review.select_one('.ratingDate')['title'].strip()
                  titre_rev_cl = review.select_one('.noQuotes').text.strip()
                  opinion_cl = review.select_one('.partial_entry').text.replace("\n","").strip()
                  row = [f"{inf_rest_name}", f"{rest_eclf}", f"{name_client}", f"{date_rev_cl}", f"{titre_rev_cl}", f"{opinion_cl}"]
                  w.writerow(row)
  </code></pre>
  
  
  
  <p>Error on excecution:</p>
  
  <blockquote>
    <p>"data = {'reviews': ','.join(ids), 'contextChoice': 'DETAIL'}
    TypeError: sequence item 0: expected str instance, NoneType found"</p>
  </blockquote>
  
  <p>and after I decided to change just values in line 6(pages of site) and 7 (Url): </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>with open("boutary.csv", "w", encoding="utf-8-sig", newline='') as csv_file:
      w = csv.writer(csv_file, delimiter = ";", quoting=csv.QUOTE_MINIMAL)
      w.writerow(["inf_rest_name", "rest_eclf", "name_client", "date_rev_cl", "titre_rev_cl", "opinion_cl"])
  
      with requests.Session() as s:
          for offset in range(40, 290, 10):
              url = f'https://www.tripadvisor.fr/Restaurant_Review-g187147-d9783452-Reviews-or{offset}-Boutary-Paris_Ile_de_France.html'
              r = s.get(url)
              soup = bs(r.content, 'lxml')
              reviews = soup.select('.reviewSelector')
              ids = [review.get('data-reviewid') for review in reviews]
              r = s.post(
                  'https://www.tripadvisor.fr/OverlayWidgetAjax?Mode=EXPANDED_HOTEL_REVIEWS_RESP&amp;metaReferer=',
                  data = {'reviews': ','.join(ids), 'contextChoice': 'DETAIL'},
                  headers = {'referer': r.url}
                  )
  
              soup = bs(r.content, 'lxml')
  
              if not offset:
                      inf_rest_name = soup.select_one('.heading').text.replace("\n","").strip()
                      rest_eclf = soup.select_one('.header_links a').text.strip()
  
              for review in soup.select('.reviewSelector'):
                  name_client = review.select_one('.info_text &gt; div:first-child').text.strip()
                  date_rev_cl = review.select_one('.ratingDate')['title'].strip()
                  titre_rev_cl = review.select_one('.noQuotes').text.strip()
                  opinion_cl = review.select_one('.partial_entry').text.replace("\n","").strip()
                  row = [f"{inf_rest_name}", f"{rest_eclf}", f"{name_client}", f"{date_rev_cl}" , f"{titre_rev_cl}", f"{opinion_cl}"]
                  w.writerow(row)</code></pre>
  </div>
  </div>
  </p>
  
  <p>and it shows me </p>
  
  <blockquote>
    <p>"row = [f"{inf_rest_name}", f"{rest_eclf}", f"{name_client}",
    f"{date_rev_cl}" , f"{titre_rev_cl}", f"{opinion_cl}"]</p>
    
    <p>NameError: name 'inf_rest_name' is not defined" </p>
  </blockquote>
  
  <p>These errors are strange because, before, I used the same code with other URL and it worked perfectly. 
  Can you tell me please what is happening? How can I run it proprerly? I will appreciate your help.</p>