Please pardon me i am new to Python and Selenium. I am scraping a supermarket website. I get the items name as below which has quantity with the name. I want to substring the quantity from the name for different cases and items as below-
Cases
Fresh Value Colocasia 250g
Fresh Value Banana Robusta 1kg
Fresh Value Raw Papaya 1 U (units) (300g-400g)
Fresh Value Premium Pomegranate Kabul (500g - 700g)
Output Needed:
Name = Fresh Value Colocasia, Quantity = 250g
Name = Fresh Value Banana Robusta, Quantity = 1kg
Name - Fresh Value Raw Papaya, Quantity = 1 U (units) (300g-400g)
It has hundreds of items like this . I have tried using
str.split()
but didn't get the output. I have also tried using regex but not sure how that works. Is there a way in which i can split the string after i find a number in string ? Any suggestions might help.