1

Is there any way to check if a button is disabled with beautiful soup. I'm trying to scrape Airbnb page and i want to check if there is a next page or not. I tried :

def findNextPage(soupPage):
''' Finds the next page with listings if it exists '''
if not(soupPage.find("div", {"class": "_jro6t0"}).find("button", {"class": "_za9j7e"}, attrs={"disabled"})):
    return "https://airbnb.com" + soupPage.find("div", {"class": "_jro6t0"}).find("a")["href"]
else:
    return "no next page"
Abdo
  • 49
  • 3

0 Answers0