scraping pagination web with beautifulsoap python
Question: just started learning python. im trying to scrape all phone number from a
paginated web site. but my code not go to paginate link and only looping on a
same page. need advice here.

    
    
    from bs4 import BeautifulSoup
    import requests
    
    for i in range(5000):
        url = "http://www.mobil123.com/mobil?type=used&page_number=1".format(i)
        r = requests.get(url)
        soup = BeautifulSoup(r.content)
    
        for record in soup.findAll('div', {"class": "card-contact-wrap"}):
            for data in soup.findAll('div', {"data-get-content": "#whatsapp"}):
                print(record.find('li').text)
                print(data.text)
    


Answer: You missed placing string formatter. Change url = "...." to

    
    
      url = "http://www.mobil123.com/mobil?type=used&page_number={0}".format(i)
    

