import requests
from bs4 import BeautifulSoup
def main(url):
r = requests.get(url)
soup = BeautifulSoup(r.content, 'html.parser')
target = soup.findAll("th", scope="row")
for tar in target:
print("Brand: {:<15}, Therapy Area - : {:<50}, SKU - : {:<30}, Strength: {}".format(
tar.text, *[item.text for item in tar.find_all_next("td")[:3]]))
main("https://www.alkemlabs.com/rx-products.php")
Образец вывода:
Brand: A TO Z , Therapy Area - : Vitamins / Minerals / Nutrients , SKU - : NEW A TO Z GOLD CAPSULES (15'S), Strength: ASCORBIC ACID + BENFOTIAMINE + BETACAROTENE + DOCONEXENT + FOLIC ACID + ICOSAPENT + PROCYANIDIN + PYRIDOXINE + THIOCTIC ACID + VITAMIN E
Brand: XONE SB , Therapy Area - : Anti-infective , SKU - : XONE SB 250MG INJECTION (VIALS), Strength: CEFTRIAXONE 250MG + SULBACTAM 125MG
Brand: XONE SB , Therapy Area - : Anti-infective , SKU - : XONE SB 500 MG INJECTION (VIALS), Strength: CEFTRIAXONE 500MG + SULBACTAM 250MG
Brand: XONE SB , Therapy Area - : Anti-infective , SKU - : XONE SB 1GM INJECTION (VIALS) , Strength: CEFTRIAXONE 1000MG + SULBACTAM 500MG
Brand: COLPEP , Therapy Area - : Gastro Intestinal , SKU - : COLPEP SUSPENSION (30ML) , Strength: DICYCLOMINE HCl 10MG + ACTIVATED DIMETHICONE 40MG / 5ML SUSP
Brand: COLPEP , Therapy Area - : Gastro Intestinal , SKU - : COLPEP DROPS (15ML) , Strength: ACTIVATED DIMETHICONE 40MG + DILL OIL 0.005ML + FENNEL OIL 0.0007MG / ML SYRUP
Brand: COLPEP , Therapy Area - : Gastro Intestinal , SKU - : COLPEP SPAS TABLETS (10'S) , Strength: Aceclofenac 100mg + Drotravarine 80mg Tablets
Brand: DIGIPEN , Therapy Area - : Gastro Intestinal , SKU - : DIGIPEN JUNIOR SYRUP (60ML) , Strength: Alpha Amylase I.P. 100Mg (Bacterial 1:800) + Papain I.P. 50 Mg
Brand: DIGIPEN , Therapy Area - : Gastro Intestinal , SKU - : DIGIPEN DROPS (15ML) , Strength: Alpha Amylase I.P. 20mg (Bacterial 1:800) + Papain I.P. 10mg + Dill oil B.P. 2mg + Anise oil B.P. 2mg + Caraway oil B.P. 2mg
Brand: DIGIPEN , Therapy Area - : Gastro Intestinal , SKU - : DIGIPEN TABLETS (10'S) , Strength: Protease 3600 HUT + Amylase 1200 SKB + Hemicellulase 600 XU +á Lipase 450 FIP + Lactalase 250 ALU + Alpha Galactosidase 50 Gal U Chewable Tablets
Brand: HEMFER , Therapy Area - : Gynaec. , SKU - : HEMFER CAPSULES (NEW)(30'S) , Strength: FERROUS GLYCINE SULPHATE 50MG (EQUI. IRON) + FOLIC ACID 0.5MG + CYANOCOBALAMINE 7.5MCG + ZINC SULPHATE 5MG (EQUI. ZINC)
Brand: HEMFER , Therapy Area - : Gynaec. , SKU - : HEMFER INJECTION (5ML) , Strength: FERRIC HYDROXIDE WITH SUCROSE 100MG (EQUI. IRON)
Brand: HEMFER , Therapy Area - : Gynaec. , SKU - : HEMFER KID SYRUP (60ML) , Strength: FERROUS GLYCINE SULPHATE 25MG (IRON EQUI.) + FOLIC ACID 0.25MG + CYANOCOBALAMINE 3.75MCG + ZINC SULPHATE MONOHYDRATEá3.5MG (ZINC EQUI.) / 5 ML DROPS
Brand: HEMFER , Therapy Area - : Gynaec. , SKU - : HEMFER SYRUP (225ML) , Strength: FERROUS GLYCINE SULPHATE 50MG (EQUI. IRON) + FOLIC ACID 0.5MG + CYANOCOBALAMINE 7.5MCG + ZINC SULPHATE 2.5MG (EQUI. ZINC) + D-BIOTIN 100MCG / 15ML
Brand: HEMFER , Therapy Area - : Gynaec. , SKU - : HEMFER DROPS (15ML) , Strength: FERROUS GLYCINE SULPHATE 10MG (IRON EQUI.) + FOLIC ACID 100MCG + CYANOCOBALAMINE 1.5MCG / ML DROPS
Brand: PIPZO , Therapy Area - : Anti-infective , SKU - : PIPZO 4.5 GM INJECTION (VIAL) , Strength: PIPERACILLIN 4G + TAZOBACTAM 500MG INJ
Brand: PIPZO , Therapy Area - : Anti-infective , SKU - : PIPZO 4.5GM INJECTION (VIAL) , Strength: PIPERACILLIN 4G + TAZOBACTAM 500MG INJ
Brand: PIPZO , Therapy Area - : Anti-infective , SKU - : PIPZO 4.5GM INJECTION (HOSPITAL SUPPLY), Strength: PIPERACILLIN 4G + TAZOBACTAM 500MG INJ
Brand: PIPZO , Therapy Area - : Anti-infective , SKU - : PIPZO-1.125 INJECTION (VIAL) , Strength: PIPERACILLIN 1G + TAZOBACTAM 125MG INJ
Brand: PIPZO , Therapy Area - : Anti-infective , SKU - : PIPZO 1.125GM INJECTION (VIAL), Strength: PIPERACILLIN 1G + TAZOBACTAM 125MG INJ
Brand: PIPZO , Therapy Area - : Anti-infective , SKU - : PIPZO 2.25 GM INJECTION (VIAL), Strength: PIPERACILLIN 2G + TAZOBACTAM 250MG INJ
Brand: PIPZO , Therapy Area - : Anti-infective , SKU - : PIPZO 2.25GM INJECTION (VIAL) , Strength: PIPERACILLIN 2G + TAZOBACTAM 250MG INJ