title: Extracting HTML content from a search page using Beautiful Soup with Python
body: <p>I'm trying to get some hotels info from booking.com using Beautiful Soup. I need to get certain info from all the accomodations in Spain. This is the search url: </p>
  
  <p><a href="https://www.booking.com/searchresults.html?aid=304142&amp;label=gen173nr-1DCAEoggJCAlhYSDNYBGigAYgBAZgBMbgBB8gBDNgBA-gBAfgBApICAXmoAgM&amp;sid=1677838e3fc7c26577ea908d40ad5faf&amp;class_interval=1&amp;dest_id=197&amp;dest_type=country&amp;dtdisc=0&amp;from_sf=1&amp;group_adults=2&amp;group_children=0&amp;inac=0&amp;index_postcard=0&amp;label_click=undef&amp;no_rooms=1&amp;oos_flag=0&amp;postcard=0&amp;raw_dest_type=country&amp;room1=A%2CA&amp;sb_price_type=total&amp;search_selected=1&amp;src_elem=sb&amp;ss=Spain&amp;ss_all=0&amp;ss_raw=spain&amp;ssb=empty&amp;sshis=0&amp;order=popularity" rel="nofollow noreferrer">https://www.booking.com/searchresults.html?aid=304142&amp;label=gen173nr-1DCAEoggJCAlhYSDNYBGigAYgBAZgBMbgBB8gBDNgBA-gBAfgBApICAXmoAgM&amp;sid=1677838e3fc7c26577ea908d40ad5faf&amp;class_interval=1&amp;dest_id=197&amp;dest_type=country&amp;dtdisc=0&amp;from_sf=1&amp;group_adults=2&amp;group_children=0&amp;inac=0&amp;index_postcard=0&amp;label_click=undef&amp;no_rooms=1&amp;oos_flag=0&amp;postcard=0&amp;raw_dest_type=country&amp;room1=A%2CA&amp;sb_price_type=total&amp;search_selected=1&amp;src_elem=sb&amp;ss=Spain&amp;ss_all=0&amp;ss_raw=spain&amp;ssb=empty&amp;sshis=0&amp;order=popularity</a></p>
  
  <p>When I inspect an accomodation in the result page using the developer tools it says that this is the tag to search:</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-html lang-html prettyprint-override"><code>&lt;a class="hotel_name_link url" href="&amp;#10;/hotel/es/aran-la-abuela.html?label=gen173nr-1DCAEoggJCAlhYSDNYBGigAYgBAZgBMbgBB8gBDNgBA-gBAfgBApICAXmoAgM;sid=1677838e3fc7c26577ea908d40ad5faf;ucfs=1;srpvid=b4980e34f6e50017;srepoch=1514167274;room1=A%2CA;hpos=1;hapos=1;dest_type=country;dest_id=197;srfid=198499756e07f93263596e1640823813c2ee4fe1X1;from=searchresults&amp;#10;;highlight_room=#hotelTmpl" target="_blank" rel="noopener"&gt;
  &lt;span class="sr-hotel__name
  " data-et-click="
  customGoal:YPNdKNKNKZJUESUPTOdJDUFYQC:1
  "&gt;
  Hotel Spa Aran La Abuela
  &lt;/span&gt;
  &lt;span class="invisible_spoken"&gt;Opens in new window&lt;/span&gt;
  &lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is my Python code:</p>
  
  <pre><code>def init_BeautifulSoup():
      global page, soup
      page= requests.get("https://www.booking.com/searchresults.html?aid=304142&amp;label=gen173nr-1DCAEoggJCAlhYSDNYBGigAYgBAZgBMbgBB8gBDNgBA-gBAfgBApICAXmoAgM&amp;sid=1677838e3fc7c26577ea908d40ad5faf&amp;class_interval=1&amp;dest_id=197&amp;dest_type=country&amp;dtdisc=0&amp;from_sf=1&amp;group_adults=2&amp;group_children=0&amp;inac=0&amp;index_postcard=0&amp;label_click=undef&amp;no_rooms=1&amp;oos_flag=0&amp;postcard=0&amp;raw_dest_type=country&amp;room1=A%2CA&amp;sb_price_type=total&amp;search_selected=1&amp;src_elem=sb&amp;ss=Spain&amp;ss_all=0&amp;ss_raw=spain&amp;ssb=empty&amp;sshis=0&amp;order=popularity")
      soup = BeautifulSoup(page.content, 'html.parser')
  
  
  def get_spain_accomodations():
      global accomodations
      accomodations = soup.find_all(class_="hotel_name_link.url")
  </code></pre>
  
  <p>But when I run the code and print the accomodations variable it outputs a pair of brackets ([]). Then I printed the soup object and I realized that the parsed HTML is very different from the one I see in the developer tools in Chrome, that's why the soup object cant find the class "hotel_name_link.url"</p>
  
  <p>What's going on?</p>