How to scrape text

Hi Everyone,
How can I scrape 10338 and 10314?
Is there a way for me not to specify the id when scraping the text column?

                            <p id="sku5390356053255446" class="">10338</p>
                            
                        
                        
                            <p class="ft_gray"><a href="https://go-go-gadget-hub.myshopify.com/admin/products/1629988356149" target="_blank" class="">1629988356149</a></p>
                        
                    </td>


                            <p id="sku5390356050913024">10314</p>
                            
                        
                        
                            <p class="ft_gray"><a href="https://go-go-gadget-hub.myshopify.com/admin/products/1626909245493" target="_blank">1626909245493</a></p>
                        
                    </td>

You can try and drill down to the 'td' level and then us a ':not(:has('attribute'))' selector.

Would look something like this - td p:not(:has(.ft_gray))

That should select the 'p' that does not have this particular class.