it is showing this error how to solve this error
—————————————————————————
AttributeError Traceback (most recent call last)
Cell In[20], line 9
5 products = jsoup.find_all(‘div’,class_=’info’)
8 for product in products:
—-> 9 Name = product.find(‘div’,class_=’name’).text.replace(‘\n’,”)
10 Price = product.find(‘div’,class_=’prc’).text.replace(‘\n’,”)
11 Discount = product.find(‘div’,class_=’bdg _dsct’).text.replace(‘\n’,”)
AttributeError: ‘NoneType’ object has no attribute ‘text’
I am getting 403 status code while accessing the web page. i.e.,
jumia=requests.get(‘https://www.jumia.co.ke/all-products/’) is returning the status_code as 403
Please help
for i in range(1,51):
url = “https://www.jumia.co.ke/all-products/”+”?page=” + str(i) + “#catalog-listing”
furl=requests.get(url)
soup=BeautifulSoup(furl.content,’html.parser’)
products=soup.find(‘div’,class_=”info”)
for product in products:
name=product.find(‘h3′,class_=’name’).text.replace(‘\n’,”)
price=product.find(‘div’,class_=’pro’).text.replace(‘\n’,”)
try:
rating=product.find(‘div’,class_=’stars_s’).text.replace(‘\n’,”)
except:
rating=’None’
name_info.append(name)
price_info.append(price)
rating_info.append(rating)
it is showing type error as output
I am getting 403 status code while accessing the web page. i.e.,
jumia=requests.get(‘https://www.jumia.co.ke/all-products/’) is returning the status_code as 403
Please solve the issue
Good Session
it is showing this error
—————————————————————————
AttributeError Traceback (most recent call last)
Cell In[20], line 9
5 products = jsoup.find_all(‘div’,class_=’info’)
8 for product in products:
—-> 9 Name = product.find(‘div’,class_=’name’).text.replace(‘\n’,”)
10 Price = product.find(‘div’,class_=’prc’).text.replace(‘\n’,”)
11 Discount = product.find(‘div’,class_=’bdg _dsct’).text.replace(‘\n’,”)
AttributeError: ‘NoneType’ object has no attribute ‘text’
it isn’t excuted
for page in range(1,51):
url = “https://www.jumia.co.ke/all-products/” + “?page=” + str(page)+”#catalog-listing”
furl = requests.get(url)
jsoup = BeautifulSoup(furl.content, ‘html.parser’)
products = jsoup.find_all(‘div’, class_=’info’)
for product in products:
Name = product.find(‘h3’, class_=”name”).text.replace(‘\n’, ”)
Price = product.find(‘div’, class_=”prc”).text.replace(‘\n’, ”)
try:
Rating = product.find(‘div’, class_=’stars_s’).text.replace(‘\n’,”)
except:
Rating = ‘None’
name_info.append(Name)
Price_info.append(Price)
Rating_info.append(Rating)
print(name_info, Price_info, Rating_info)
same here, how did you solve this problem
it is showing this error how to solve this error
—————————————————————————
AttributeError Traceback (most recent call last)
Cell In[20], line 9
5 products = jsoup.find_all(‘div’,class_=’info’)
8 for product in products:
—-> 9 Name = product.find(‘div’,class_=’name’).text.replace(‘\n’,”)
10 Price = product.find(‘div’,class_=’prc’).text.replace(‘\n’,”)
11 Discount = product.find(‘div’,class_=’bdg _dsct’).text.replace(‘\n’,”)
AttributeError: ‘NoneType’ object has no attribute ‘text’
I was actually a nice project covered in this session, for beginners it is very helpful.
It was actually a nice project covered in this session, for beginners it is very helpful.
I am getting 403 status code while accessing the web page. Please help
I am getting 403 status code while accessing the web page. i.e.,
jumia=requests.get(‘https://www.jumia.co.ke/all-products/’) is returning the status_code as 403
Please help
for page in range(1,51):
url = “https://www.jumia.co.ke/” + “?page=” + str(page) + “#catalog-listing”
furl = requests.get(url)
jsoup = BeautifulSoup(furl.content, ‘html.parser’)
products = jsoup.find_all(‘div’,class_=”info”)
for product in products:
Name = product.find(‘div’,class_=’name’).text.replace(‘\n’, ”)
Price = product.find(‘div’,class_=’prc’).text.replace(‘\n’, ”)
try:
Rating = product.find(‘div’,class_=’stars_s’).text.replace(‘\n’, ”)
except AttributeError:
Rating =’None’
name_info.append(Name)
price_info.append(Price)
Rating_info.append(Rating)
print (name_info, price_info, Rating_info)
I dont know why but its coming an empty output
same here
for i in range(1,51):
url = “https://www.jumia.co.ke/all-products/”+”?page=” + str(i) + “#catalog-listing”
furl=requests.get(url)
soup=BeautifulSoup(furl.content,’html.parser’)
products=soup.find(‘div’,class_=”info”)
for product in products:
name=product.find(‘h3′,class_=’name’).text.replace(‘\n’,”)
price=product.find(‘div’,class_=’pro’).text.replace(‘\n’,”)
try:
rating=product.find(‘div’,class_=’stars_s’).text.replace(‘\n’,”)
except:
rating=’None’
name_info.append(name)
price_info.append(price)
rating_info.append(rating)
it is showing type error as output
I am getting 403 status code while accessing the web page. i.e.,
jumia=requests.get(‘https://www.jumia.co.ke/all-products/’) is returning the status_code as 403
Please solve the issue
not understand this project