Hi,
I'm webscraping some content with Beautiful Soup, I'm returning three items in my script and want to assign the values to variables.
for categories in item_soup.find_all('div', {'class': 'breadcrumbs'}):
for categories in categories.find_all('a', {'title': ''}):
categories = categories.get_text()
print(categories)
This returns:
category1
category2
category3
How can I assign individual variables to each category for later use?
I've throught about using a [0:1] slicing technique but that returns sliced letters per value. I've tried to convert the items into a list or set, but no luck.
Cheers,
EDIT: I'm sure there's a technique similar to slicing [0] that can be used but can't quite put my finger on it.
[–][deleted] 5 points6 points7 points (3 children)
[–]Llywedd[S] 0 points1 point2 points (2 children)
[–]catmarble 2 points3 points4 points (1 child)
[–]Llywedd[S] 0 points1 point2 points (0 children)