I am trying to extract the text within all the 'a' tags from this code, i get an error:
(AttributeError: ResultSet object has no attribute 'find_all'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?)
What am i doing wrong?
import json
import time
from datetime import datetime
from discord import Webhook, RequestsWebhookAdapter
from discord_webhook import DiscordWebhook, DiscordEmbed
import discord
from bs4 import BeautifulSoup
from discord.ext import commands
r = requests.get("https://www.hypedc.com/nz/nike-air-force-1-07-black-black-cw2288-001")
soup = BeautifulSoup(r.content, 'lxml')
size = soup.find('div', id="size-selector-tab-mobile-0")
size = size.find_all('li', class_='col-xs-6 col-sm-8 col-md-6 col-lg-4')
size = size.find_all('a').text
print(size)
question from:https://stackoverflow.com/questions/65621734/extracting-data-from-html-using-python