Answer the question
In order to leave comments, you need to log in
Why doesn't find_all work when parsing a site?
def parse():
url = 'https://www.olx.ua/list/q-'+message.text+'/'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
oholoshennja = soup.find_all('div', class_='offer-wrapper')
data = []
for posts in oholoshennja:
post = oholoshennja.find('td', class_='title-cell').find('h3',class_='lheight22').find('a',class_='marginright5').find('strong')
post_url = oholoshennja.find('td', class_='title-cell').find('h3',class_='lheight22').find('a',class_='marginright5').get('href')
located = oholoshennja.find('td', class_='bottom-cell').find('div', class_='space').find('p', class_='lheight16').find_all('small', class_='breadcrumb').find_all('span')
price = oholoshennja.find('p', class_='price').find('strong')
data.append([post.text, price.text, located.text, post_url])
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question