Mar-03-2021, 01:41 AM
So I am trying to pull data from a website via a scraper.
When I try this code out I am getting an error
When I try this code out I am getting an error
wo_span_name = w_span_name.text AttributeError: 'NoneType' object has no attribute 'text'The weird part is the div, and class exsist, and if I don't try a .text command it will print the Div class
"<div class=""phones phone primary"">(Data I am looking for)</div>"I know I am missing something small, but don't know what.
##Already have code to pull, and parcer the site into html for findcard in soupurl.find_all('div', class_="v-card"): #Declaring global varibles global wo_span_name global wo_div_phone #grab name w_span_name = findcard.find('a', class_='business-name') wo_span_name = w_span_name.text #grab phone number w_div_phone = findcard.find('div', class_="phones phone primary") wo_div_phone = w_div_phone.text #Adding items to list phone_list.append(wo_div_phone) name_list.append(wo_span_name)