How to get all product categories?

I'm trying to scrape webshop that has same products under multiple categories. I want to get every category + sub category combination where you can find the product. Doing things like in the tutorial video seems to lead situation where it either skips products it has already scraped or saves the what it got in last time it find the product, either way I get all the products there is, but they all have just one category and sub category. I would be fine with getting duplicates of the products if I just get all the category combinations that way. Or if there is some sophisticated way to get all the categories and subcategories saved to one product would be fine too.