Posts

Showing posts with the label urllib

Attribute Error: 'None Type' object has no attribute 'get_text'

Attribute Error: 'None Type' object has no attribute 'get_text' I have tried this program as I am scrapping data from Amazon but this program giving me the error. instead of get_text I also tried extract() and only strip () also they all are giving Attribute error. Now please help me what should I do? import urllib.request from bs4 import BeautifulSoup import pymysql.cursors a = input ('enter the item to be searched :') a = a.replace(" ","") html = urllib.request.urlopen("https://www.amazon.in/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords="+a) bsObj = BeautifulSoup(html,'lxml') recordList = bsObj.findAll('a', class_='a-link-normal a-text-normal') connection = pymysql.connect(host='localhost', user='root', password='', db='shopping', charset='utf8mb4', ...