I'm new to python and I am trying to code a crawler, my issue is that I cannot get the href links I am targeting to display in the console. Any help is appreciated, see below.
import requests
from bs4 import BeautifulSoup
def trade_spider(max_pages):
page = 1
while page <= max_pages:
url = 'http://www.rent.ie/houses-to-let/renting_dublin/page_'+ str(page)
source_code = requests.get(url)
plain_text = source_code.text
soup = BeautifulSoup(plain_text)
special_divs = soup.findAll('div', {'class':'search_result_title_box'})
for link in special_divs:
gold = link.findAll('a')
for link in gold:
href = gold.get(link['href'])
print(href)
page += 1
trade_spider(3)