I am trying to scrape projects' URLs from the Kickstarter webpage using Beautiful Soup. I am using the following code:
import requests
from bs4 import BeautifulSoup
url = 'https://www.kickstarter.com/discover/advanced?category_id=28&staff_picks=1&sort=newest&seed=2639586&page=1'
page = requests.get(url)
soup = BeautifulSoup(page.text, 'html.parser')
project_name_list = soup.find(class_='grid-row flex flex-wrap')
project_name_list_items = project_name_list.find_all('a')
print(project_name_list_items)
for project_name in project_name_list_items:
links = project_name.get('href')
print(links)
But this is what I get as output:
[<a class="block img-placeholder w100p"><div class="img-placeholder bg-grey-400 absolute t0 w100p"></div></a>, <a class="block img-placeholder w100p"><div class="img-placeholder bg-grey-400 absolute t0 w100p"></div></a>, <a class="block img-placeholder w100p"><div class="img-placeholder bg-grey-400 absolute t0 w100p"></div></a>, <a class="block img-placeholder w100p"><div class="img-placeholder bg-grey-400 absolute t0 w100p"></div></a>, <a class="block img-placeholder w100p"><div class="img-placeholder bg-grey-400 absolute t0 w100p"></div></a>, <a class="block img-placeholder w100p"><div class="img-placeholder bg-grey-400 absolute t0 w100p"></div></a>]
None
None
None
None
None
None
I tried several ways, such as:
for link in soup.find_all('a'):
print(link.get('href'))
But still no results. Also, this page that I am scraping has a "Load more" part at the end of the page. How can I get the URLs in that part? I appreciate your help.