Я пытаюсь убрать мобильные данные с Flipkart. Ниже приведен код, который я написал
Below is the actual code of the image:
home_page_link = "https://www.flipkart.com"
href = "/search?q=mobiles&as=on&as- show=on&otracker=AS_Query_TrendingAutoSuggest_1_0_na_na_na&otracker1=AS_Query_TrendingAutoSuggest_1_0_na_na_na&as-pos=1&as-type=TRENDING&suggestionId=mobiles&requestId=55feeb8d-8549-48a8-9325-1c0e8756151e&page=1"
url = home_page_link + href
for i in range(1, 101):
print("page: ", i)
page_response = requests.get(url)
print(page_response)
soup = BeautifulSoup(page_response.content, 'html.parser')
# cards = soup.find_all('div', attrs={'class': '_1UoZlX'})
# for card in cards:
# name = card.find("div", attrs={'class': '_3wU53n'})
# price = card.find('div', attrs={'class': '_1vC4OE'})
# print(name.text, price.text)
next_link = soup.find("a",text = "Next")
print(type(next_link))
link = next_link.get("href")
home_page_link = "https://www.flipkart.com"
next_page_link = home_page_link + link
url = next_page_link
I got nonetype object at page 29:
After executing the same code again:
введите описание изображения здесь