title: How to crawl href - Python & beautifulsoup
body: <p>I am currently crawling a web page (<a href="https://www.klook.com/city/30-kyoto/?p=1" rel="nofollow noreferrer">https://www.klook.com/city/30-kyoto/?p=1</a>) using Python 3.4 and bs4 in order to collect the deeplinks of the respective activities.</p>
  
  <p>I found that the links are located in the html source like this:</p>
  
  <pre><code>&lt;a class="j_activity_item_link" href="/activity/1031-arashiyama-rickshaw-tour-kyoto/" class="j_activity_item_link" data-card-tags="{}" data-sold-out="false" data-price="40.0" data-city-id="30" data-id="1031" data-url-seo="arashiyama-rickshaw-tour-kyoto"&gt;
  </code></pre>
  
  <p>But after several trials, this <code>href="/activity/1031-arashiyama-rickshaw-tour-kyoto/"</code> never show up. </p>
  
  <p>Here is my logic so far:</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  
  user_agent = {'User-agent': 'Chrome/43.0.2357'}
  
  for page in range(1,6):
      r = requests.get("https://www.klook.com/city/30-kyoto" + "/?p=" +  str(page))
      soup = BeautifulSoup(r.content, "lxml")
  
      g_data = soup.find_all("a", {"class": "j_activity_item_link"})
      for item in g_data:
          Deeplink = item.find_all("a")
          for t in Deeplink:
              print(t.get("href"))
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Process finished with exit code 0
  </code></pre>
  
  <p>Could you guys help me put? Any feedback is appreciated.</p>