'Function returns no value - web scraping [closed]

I am trying to web scrap data from otodom without selenium/scrapy.

Problem is, function getnextpage does not fetch any information on the page = soup.find('nav',{'class':'css-geek62'}) stage.

I have double checked the classes and identifiers, but error remains.

from requests_html import HTMLSession
from bs4 import BeautifulSoup as bs

URL = "https://www.otodom.pl/pl/oferty/sprzedaz/dzialka/mazowieckie"

s = HTMLSession()

def getdata(URL):
    r=s.get(URL)
    soup = bs(r.text,'html.parser')
    return soup

def getnextpage(soup):
    page = soup.find('nav',{'class':'css-geek62'})
    if not page.find('button',{'class':'eoupkm71 css-1lc8b1f e11e36i3'}):
        url = 'http://www.w3.org/2000/svg' + str(page.find('button',{'class':'eoupkm71 css-43vth9 e11e36i3'})).find('svg')['href']
        return url
    else:
        return

Would be grateful for any advice.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source