Scrap the stackflow user data : import requests
from bs4 import BeautifulSoup
import pandas as pd
import csv


url='https://stackoverflow.com/users'

response= requests.get(url)

html=response.content

soup= BeautifulSoup(html, 'html.parser')

all_table= soup.find("table")

l=len(soup.find_all('div', class_='container'))
print(l)

divs= soup.find_all("div", class_='container')

i=0

with open('stackdata.csv', 'a') as csv_file:
    writer=csv.writer(csv_file)
    for div in divs:
        print(div.text)
        name_box=soup.find('div', attrs={'class': 'user-details'})
        name=name_box.text
        print(name)
        writer.writerow([name])


div.text print the all data but when I want to write in csv file it goes only one upper data.